8055955: (ch) Remove unnecessary initialization of InetAddress from FileChannel

Reviewed-by: alanb
This commit is contained in:
Chris Hegarty 2014-08-26 10:19:56 +01:00
parent 7c8053cd97
commit 27d481fa82
9 changed files with 14 additions and 5 deletions

View File

@ -79,6 +79,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_InheritedChannel_close0;
Java_sun_nio_ch_InheritedChannel_dup;
Java_sun_nio_ch_InheritedChannel_dup2;
Java_sun_nio_ch_InheritedChannel_initIDs;
Java_sun_nio_ch_InheritedChannel_open0;
Java_sun_nio_ch_InheritedChannel_peerAddress0;
Java_sun_nio_ch_InheritedChannel_peerPort0;

View File

@ -62,6 +62,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_InheritedChannel_close0;
Java_sun_nio_ch_InheritedChannel_dup;
Java_sun_nio_ch_InheritedChannel_dup2;
Java_sun_nio_ch_InheritedChannel_initIDs;
Java_sun_nio_ch_InheritedChannel_open0;
Java_sun_nio_ch_InheritedChannel_peerAddress0;
Java_sun_nio_ch_InheritedChannel_peerPort0;

View File

@ -67,6 +67,7 @@ SUNWprivate_1.1 {
Java_sun_nio_ch_InheritedChannel_close0;
Java_sun_nio_ch_InheritedChannel_dup;
Java_sun_nio_ch_InheritedChannel_dup2;
Java_sun_nio_ch_InheritedChannel_initIDs;
Java_sun_nio_ch_InheritedChannel_open0;
Java_sun_nio_ch_InheritedChannel_peerAddress0;
Java_sun_nio_ch_InheritedChannel_peerPort0;

View File

@ -226,6 +226,7 @@ class InheritedChannel {
// -- Native methods --
private static native void initIDs();
private static native int dup(int fd) throws IOException;
private static native void dup2(int fd, int fd2) throws IOException;
private static native int open0(String path, int oflag) throws IOException;
@ -236,5 +237,6 @@ class InheritedChannel {
static {
IOUtil.load();
initIDs();
}
}

View File

@ -35,7 +35,6 @@
#include "java_lang_Integer.h"
#include "nio.h"
#include "nio_util.h"
#include "net_util.h"
static jfieldID fd_fdID; /* for jint 'fd' in java.io.FileDescriptor */
@ -45,7 +44,6 @@ Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
{
CHECK_NULL(clazz = (*env)->FindClass(env, "java/io/FileDescriptor"));
CHECK_NULL(fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I"));
initInetAddressIDs(env);
}
JNIEXPORT jboolean JNICALL

View File

@ -47,6 +47,13 @@ static int matchFamily(struct sockaddr *sa) {
return (family == AF_INET);
}
JNIEXPORT void JNICALL
Java_sun_nio_ch_InheritedChannel_initIDs(JNIEnv *env, jclass cla)
{
/* Initialize InetAddress IDs before later use of NET_XXX functions */
initInetAddressIDs(env);
}
JNIEXPORT jobject JNICALL
Java_sun_nio_ch_InheritedChannel_peerAddress0(JNIEnv *env, jclass cla, jint fd)
{

View File

@ -151,7 +151,7 @@ static jboolean isSourceFilterSupported(){
JNIEXPORT void JNICALL
Java_sun_nio_ch_Net_initIDs(JNIEnv *env, jclass clazz)
{
/* Here because Windows native code does need to init IDs */
initInetAddressIDs(env);
}
JNIEXPORT jboolean JNICALL

View File

@ -56,7 +56,6 @@ Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
CHECK_NULL(clazz = (*env)->FindClass(env, "java/io/FileDescriptor"));
CHECK_NULL(fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I"));
CHECK_NULL(handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J"));
initInetAddressIDs(env);
}
/**************************************************************

View File

@ -81,7 +81,7 @@ static void setConnectionReset(SOCKET s, BOOL enable) {
JNIEXPORT void JNICALL
Java_sun_nio_ch_Net_initIDs(JNIEnv *env, jclass clazz)
{
/* nothing to do */
initInetAddressIDs(env);
}
JNIEXPORT jboolean JNICALL