changeset 6707:51cd5710d96e

Merge
author vinnie
date Tue, 23 Jul 2013 00:47:37 +0100
parents 6cd79e876c2c fe948b47f3c0
children d41a1959df12
files
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/java/net/net_util.c	Tue Jul 23 00:46:10 2013 +0100
+++ b/src/share/native/java/net/net_util.c	Tue Jul 23 00:47:37 2013 +0100
@@ -75,7 +75,7 @@
 
 static int initialized = 0;
 
-void init(JNIEnv *env) {
+static void initInetAddrs(JNIEnv *env) {
     if (!initialized) {
         Java_java_net_InetAddress_init(env, 0);
         Java_java_net_Inet4Address_init(env, 0);
@@ -96,42 +96,43 @@
 
 void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) {
     jobject holder;
-    init(env);
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_addressID, address);
 }
 
 void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) {
     jobject holder;
-    init(env);
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetIntField(env, holder, iac_familyID, family);
 }
 
 void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) {
     jobject holder;
-    init(env);
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     (*env)->SetObjectField(env, holder, iac_hostNameID, host);
 }
 
 int getInetAddress_addr(JNIEnv *env, jobject iaObj) {
     jobject holder;
-    init(env);
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_addressID);
 }
 
 int getInetAddress_family(JNIEnv *env, jobject iaObj) {
     jobject holder;
-    init(env);
+
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetIntField(env, holder, iac_familyID);
 }
 
 jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) {
     jobject holder;
-    init(env);
+    initInetAddrs(env);
     holder = (*env)->GetObjectField(env, iaObj, ia_holderID);
     return (*env)->GetObjectField(env, holder, iac_hostNameID);
 }
@@ -139,7 +140,7 @@
 JNIEXPORT jobject JNICALL
 NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) {
     jobject iaObj;
-    init(env);
+    initInetAddrs(env);
 #ifdef AF_INET6
     if (him->sa_family == AF_INET6) {
         jbyteArray ipaddress;