harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r576185 [3/4] - in /harmony/enhanced/classlib/branches/java6/modules: archive/src/main/native/archive/shared/ auth/ auth/src/main/java/common/org/apache/harmony/auth/module/ auth/src/test/java/common/org/apache/harmony/auth/tests/module/ au...
Date Sun, 16 Sep 2007 21:56:47 GMT
Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c Sun Sep 16 14:56:42 2007
@@ -58,7 +58,6 @@
 	jobject	anInetAddress)
 {
   jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_address);
-  //jfieldID fid = getJavaNetDatagramPacketAddress(env);
   (*env)->SetObjectField (env, datagramPacket, fid, anInetAddress);
 }
 
@@ -74,7 +73,6 @@
 setDatagramPacketPort (JNIEnv *	env, jobject datagramPacket, U_16 hPort)
 {
   jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_port);  
-  //jfieldID fid = getJavaNetDatagramPacketPort(env);
   (*env)->SetIntField (env, datagramPacket, fid, hPort);
 }
 
@@ -90,7 +88,6 @@
 setDatagramPacketLength	(JNIEnv	* env, jobject datagramPacket, I_32 length)
 {
   jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_DatagramPacket_length);
-  //jfieldID fid = getJavaNetDatagramPacketLength(env);
   (*env)->SetIntField (env, datagramPacket, fid, length);
 }
 
@@ -146,15 +143,10 @@
   	  HARMONY_CACHE_GET	(env,
   	     FID_java_net_InetAddress_address),	
   	  newJavaByteArray (env, ipv4Addr, length));
-  /* 
-    (*env)->SetObjectField (env, senderAddress,
-	getJavaNetInetAddressIpaddress(env),
-	newJavaByteArray (env, ipv4Addr, length));
-  */
-  if (harmony_supports_ipv6	(env) && (scope_id != 0))
+  if (harmony_supports_ipv6(env) && (scope_id != 0))
     {
-      jclass tempClass = getJavaNetInetAddressClass(env);
       jfieldID fid = NULL;
+      jclass tempClass = HARMONY_CACHE_GET(env, CLS_java_net_InetAddress);
 
       fid = (*env)->GetFieldID (env, tempClass,	"scope_id", "I");
       if ((*env)->ExceptionCheck (env))	
@@ -210,7 +202,6 @@
 setSocketImplAddress (JNIEnv * env, jobject socketImpl,	jobject	anInetAddress)
 {
   jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_SocketImpl_address);  
-  //jfieldID fid = getJavaNetSocketImplAddress(env);
   (*env)->SetObjectField (env, socketImpl, fid,	anInetAddress);	
 }
 
@@ -226,7 +217,6 @@
 setSocketImplPort (JNIEnv * env, jobject socketImpl, U_16 hPort)
 {
   jfieldID fid = HARMONY_CACHE_GET (env, FID_java_net_SocketImpl_port);  
-  //jfieldID fid = getJavaNetSocketImplPort( env);
   (*env)->SetIntField (env, socketImpl,	fid, hPort);
 }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/file.c Sun Sep 16 14:56:42 2007
@@ -124,10 +124,6 @@
     return NULL;
 
   javaClass = HARMONY_CACHE_GET (env, CLS_array_of_byte);
-  javaClass = (*env)->NewLocalRef(env, javaClass);
-  if (javaClass == NULL) {
-      return NULL;
-  }
   answer =
     (*env)->NewObjectArray (env, numEntries, javaClass, NULL);
 cleanup:
@@ -525,7 +521,7 @@
   jclass arrayClass = (*env)->FindClass (env, "[B");
   if (arrayClass)
     {
-      jobject globalRef = (*env)->NewWeakGlobalRef (env, arrayClass);
+      jobject globalRef = (*env)->NewGlobalRef (env, arrayClass);
       if (globalRef)
         HARMONY_CACHE_SET (env, CLS_array_of_byte, globalRef);
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/luniglob.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/luniglob.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/luniglob.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/luniglob.c Sun Sep 16 14:56:42 2007
@@ -416,21 +416,33 @@
   /* clean up class references */
   classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Boolean);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
 
   classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Byte);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
 
   classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Integer);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
 
   classRef = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
+
+  classRef = HARMONY_CACHE_GET (env, CLS_java_net_Socket);
+  if (classRef)
+    (*env)->DeleteGlobalRef (env, classRef);
+
+  classRef = HARMONY_CACHE_GET (env, CLS_java_lang_Long);
+  if (classRef)
+    (*env)->DeleteGlobalRef (env, classRef);
+
+  classRef = HARMONY_CACHE_GET (env, CLS_java_net_Inet6Address);
+  if (classRef)
+    (*env)->DeleteGlobalRef (env, classRef);
 
   classRef = HARMONY_CACHE_GET (env, CLS_array_of_byte);
   if (classRef)
-    (*env)->DeleteWeakGlobalRef (env, (jweak) classRef);
+    (*env)->DeleteGlobalRef (env, classRef);
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.c Sun Sep 16 14:56:42 2007
@@ -36,6 +36,11 @@
   jfieldID fid;
   jobject globalRef;
 
+  if (HARMONY_CACHE_GET (env, CLS_java_lang_Boolean)) {
+    /* Cache is already initialized */
+    return;
+  }
+
   /* Set the Harmony ID cache to use IPv6 address support */
   HARMONY_CACHE_SET (env, harmony_supports_ipv6, ipv6_support);
 
@@ -43,7 +48,7 @@
   lookupClass = (*env)->FindClass (env, "java/lang/Boolean");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(Z)V");
@@ -60,7 +65,7 @@
   lookupClass = (*env)->FindClass (env, "java/lang/Byte");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(B)V");
@@ -77,7 +82,7 @@
   lookupClass = (*env)->FindClass (env, "java/lang/Integer");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(I)V");
@@ -94,7 +99,7 @@
   lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   fid = (*env)->GetFieldID (env, lookupClass, "ipaddress", "[B");
@@ -112,6 +117,11 @@
     return;
   HARMONY_CACHE_SET (env, MID_java_net_InetAddress_preferIPv6Addresses, mid);
 
+  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "()V");
+  if (!mid)
+    return;
+  HARMONY_CACHE_SET (env, MID_java_net_InetAddress_init, mid);
+
   if (ipv6_support)
     {
       /* static InetAddress getByAddress( String name, byte[] address ) */
@@ -156,7 +166,7 @@
   lookupClass = (*env)->FindClass (env, "java/net/Socket");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   mid =
@@ -183,112 +193,24 @@
   lookupClass = (*env)->FindClass (env, "java/lang/Long");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   HARMONY_CACHE_SET (env, CLS_java_lang_Long, globalRef);
   fid = (*env)->GetFieldID (env, lookupClass, "value", "J");
-    if (!lookupClass)
+  if (!lookupClass)
     return;
   HARMONY_CACHE_SET (env, FID_java_lang_Long_value, fid);
   lookupClass = (*env)->FindClass (env, "java/net/Inet6Address");
   if (!lookupClass)
     return;
-  globalRef = (*env)->NewWeakGlobalRef (env, lookupClass);
+  globalRef = (*env)->NewGlobalRef (env, lookupClass);
   if (!globalRef)
     return;
   HARMONY_CACHE_SET (env, CLS_java_net_Inet6Address, globalRef);
-  lookupClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "()V");
-  if (!mid)
-    return;
-  HARMONY_CACHE_SET (env, MID_java_net_InetAddress_init, mid);
   
 }
 
-
-/*--------------------------------------
-//reflect function
-----------------------------------------*/
-jclass 
-getJavaLangBooleanClass(JNIEnv * env);
-
-jmethodID
-getJavaLangBooleanInit(JNIEnv * env);
-
-jfieldID
-getJavaLangBooleanValue(JNIEnv * env);
-
-jclass
-getJavaLangByteClass(JNIEnv * env);
-
-jmethodID
-getJavaLangByteInit(JNIEnv * env);
-
-jfieldID
-getJavaLangByteValue(JNIEnv * env);
-
-jclass
-getJavaLangIntegerClass(JNIEnv * env);
-
-jmethodID
-getJavaLangIntegerInit(JNIEnv * env);
-
-jfieldID
-getJavaLangIntegerValue(JNIEnv * env);
-
-jclass
-getJavaNetInetAddressClass(JNIEnv * env);
-
-jfieldID
-getJavaNetInetAddressIpaddress(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressPreferIPv6Addresses(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressGetByAddressStringByte(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressGetByAddressByteArray(JNIEnv * env);
-jmethodID
-getJavaNetInetAddressInitByteArray(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressInitByteString(JNIEnv * env);
-
-jclass
-getJavaNetSocketClass(JNIEnv * env);
-
-jmethodID
-getJavaNetSocketPreferIPv4Stack(JNIEnv * env);
-
-jclass
-getJavaLangThreadClass(JNIEnv * env);
-
-jmethodID
-getJavaLangThreadYield(JNIEnv * env);
-
-jclass
-getJavaNetDatagramPacketClass(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketAddress(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketLength(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketPort(JNIEnv * env);
-
-jfieldID
-getJavaNetSocketImplAddress(JNIEnv * env);
-
-jfieldID
-getJavaNetSocketImplPort(JNIEnv * env);
-
-
-
 /**
  * Set the exception state of the VM with a new java.lang.IllegalArgumentException.
  *
@@ -468,9 +390,7 @@
   jmethodID tempMethod;
 
   tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Boolean);
-  //tempClass = getJavaLangBooleanClass(env);
   tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Boolean_init);
-  //tempMethod = getJavaLangBooleanInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jboolean) aBool);
 }
 
@@ -491,8 +411,6 @@
 
   tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Byte);
   tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Byte_init);
-  //tempClass = getJavaLangByteClass(env);
-  //tempMethod = getJavaLangByteInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jbyte) aByte);
 }
 
@@ -513,8 +431,6 @@
 
   tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Integer);
   tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Integer_init);
-  //tempClass = getJavaLangIntegerClass(env);
-  //tempMethod = getJavaLangIntegerInit(env);
   return (*env)->NewObject (env, tempClass, tempMethod, (jint) anInt);
 }
 
@@ -580,9 +496,6 @@
         GetBooleanField (env, aBoolean,
              HARMONY_CACHE_GET (env,
                 FID_java_lang_Boolean_value)));
-  /*return (BOOLEAN) ((*env)->
-        GetBooleanField (env, aBoolean,
-             getJavaLangBooleanValue(env)));*/
 }
 
 /**
@@ -600,9 +513,6 @@
   return (U_8) ((*env)->
     GetByteField (env, aByte,
             HARMONY_CACHE_GET (env, FID_java_lang_Byte_value)));
-  /*return (U_8) ((*env)->
-    GetByteField (env, aByte,
-            getJavaLangByteValue(env)));*/
 }
 
 /**
@@ -621,9 +531,6 @@
      GetIntField (env, anInteger,
             HARMONY_CACHE_GET (env,
                FID_java_lang_Integer_value)));
-  /*return (I_32) ((*env)->
-     GetIntField (env, anInteger,
-            getJavaLangIntegerValue(env)));*/
 }
 
 /**
@@ -754,10 +661,11 @@
 /**
  * Answer the 'address' field value from a java.net.InetAddress
  *
- * @param env           pointer to the JNI library
- * @param anInetAddress   the object to access the 'value' field of
+ * @param[in]  env            pointer to the JNI library
+ * @param[in]  anInetAddress  the object to access the 'value' field of
+ * @param[out] buffer         bytes from the address jbyte array
+ * @param[out] length         length of the address in stored in buffer
  *
- * @return  the 'address' field integer value (completion status is not returned)
  */
 
 void
@@ -768,9 +676,6 @@
     (jbyteArray) ((*env)->GetObjectField (env, anInetAddress,
             HARMONY_CACHE_GET (env,
                FID_java_net_InetAddress_address)));
-  /*jbyteArray byte_array =
-    (jbyteArray) ((*env)->GetObjectField (env, anInetAddress,
-            getJavaNetInetAddressIpaddress(env)));*/
   *length = (*env)->GetArrayLength (env, byte_array);
   (*env)->GetByteArrayRegion (env, byte_array, 0, *length, (jbyte *)buffer);
 }
@@ -792,8 +697,6 @@
   tempClass = HARMONY_CACHE_GET (env, CLS_java_lang_Thread);
   tempMethod = HARMONY_CACHE_GET (env, MID_java_lang_Thread_yield);
   
-  //tempClass = getJavaLangThreadClass(env);
-  //tempMethod = getJavaLangThreadYield(env);
   if (tempClass == 0)
     {
       tempClass = (*env)->FindClass (env, "java/lang/Thread");
@@ -835,7 +738,7 @@
   U_32 i, length;
   jobjectArray aliases = NULL;
   jobject element;
-  jclass tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress); //(*env)->FindClass (env, "java/net/InetAddress");
+  jclass tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
 
   /* Number of structures */
   for (i = 0; i < count; i++)
@@ -1006,6 +909,7 @@
   static jbyte IPv6ANY[16] =
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
   U_32 i = 0;
+  jobject result;
 
   /* check if the address being returned is the any address.  If so we need to check the prefer flags to see how it should be returned
   (either as IPv4 Any or IPv6 ANY) */
@@ -1069,11 +973,6 @@
             "getByAddress",
             "([BI)Ljava/net/InetAddress;");
           
-          /*tempMethodWithScope =
-            (*env)->GetStaticMethodID (env,
-            getJavaNetInetAddressClass(env),
-            "getByAddress",
-            "([BI)Ljava/net/InetAddress;");*/
           if ((*env)->ExceptionCheck (env))
             {
               (*env)->ExceptionClear (env);
@@ -1085,21 +984,22 @@
         {
           /* create using the scope id */
           tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
-          //tempClass = getJavaNetInetAddressClass(env);
-          return (*env)->CallStaticObjectMethod (env, tempClass,
+          result = (*env)->CallStaticObjectMethod (env, tempClass,
             tempMethodWithScope,
             byte_array, scope_id);
+          (*env)->ExceptionCheck(env);
+          return result;
         }
       else
         {
           tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
-          //tempClass = getJavaNetInetAddressClass(env);
           tempMethod =
             HARMONY_CACHE_GET (env,
             MID_java_net_InetAddress_getByAddress_byteArray);
-          //tempMethod = getJavaNetInetAddressGetByAddressByteArray(env);
-          return (*env)->CallStaticObjectMethod (env, tempClass, tempMethod,
+          result = (*env)->CallStaticObjectMethod (env, tempClass, tempMethod,
             byte_array);
+          (*env)->ExceptionCheck(env);
+          return result;
         }
     }
   else
@@ -1107,8 +1007,6 @@
       tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
       tempMethod =
         HARMONY_CACHE_GET (env, MID_java_net_InetAddress_init_byteArray);
-      //tempClass = getJavaNetInetAddressClass(env);
-      //tempMethod = getJavaNetInetAddressInitByteArray(env);
       return (*env)->NewObject (env, tempClass, tempMethod, byte_array);
     }
 }
@@ -1205,11 +1103,6 @@
             "getByAddress",
             "(Ljava/lang/String;[BI)Ljava/net/InetAddress;");
           
-          /*tempMethodWithScope =
-            (*env)->GetStaticMethodID (env,
-            getJavaNetInetAddressClass(env),
-            "getByAddress",
-            "(Ljava/lang/String;[BI)Ljava/net/InetAddress;");*/
           if ((*env)->ExceptionCheck (env))
             {
               (*env)->ExceptionClear (env);
@@ -1221,7 +1114,6 @@
         {
           /* create using the scope id */
           tempClass = HARMONY_CACHE_GET (env, CLS_java_net_InetAddress);
-          //tempClass = getJavaNetInetAddressClass(env);
           return (*env)->CallStaticObjectMethod (env, tempClass,
             tempMethodWithScope, aString,
             byte_array, scope_id);
@@ -1233,8 +1125,6 @@
             HARMONY_CACHE_GET (env,
             MID_java_net_InetAddress_getByAddress_Ljava_lang_String_byteArray);
           
-          //tempClass = getJavaNetInetAddressClass(env);
-          //tempMethod = getJavaNetInetAddressGetByAddressStringByte(env);
           return (*env)->CallStaticObjectMethod (env, tempClass, tempMethod,
             aString, byte_array);
         }
@@ -1246,8 +1136,6 @@
           HARMONY_CACHE_GET (env,
           MID_java_net_InetAddress_init_byteArrayLjava_lang_String);
         
-        //tempClass = getJavaNetInetAddressClass(env);
-        //tempMethod = getJavaNetInetAddressInitByteString(env);        
         return (*env)->NewObject (env, tempClass, tempMethod, byte_array,
           aString);
     }
@@ -1315,10 +1203,6 @@
              HARMONY_CACHE_GET (env,
                 MID_java_net_Socket_preferIPv4Stack));
   
-  /*result =
-    (*env)->CallStaticBooleanMethod (env,
-             getJavaNetSocketClass(env),
-             getJavaNetSocketPreferIPv4Stack(env));*/
   if ((*env)->ExceptionCheck (env))
     {
       /* older JCLs do not have the right code for security checks so this may fail with an exception
@@ -1357,11 +1241,7 @@
                 CLS_java_net_InetAddress),
              HARMONY_CACHE_GET (env,
                 MID_java_net_InetAddress_preferIPv6Addresses));
-  /*
-  result =
-    (*env)->CallStaticBooleanMethod (env,
-             getJavaNetInetAddressClass(env),
-             getJavaNetInetAddressPreferIPv6Addresses(env));*/ 
+
   if ((*env)->ExceptionCheck (env))
     {
       /* older JCLs do not have the right code for security checks so this may fail with an exception
@@ -1413,329 +1293,6 @@
   /* clear any exception that might have occured */
   (*env)->ExceptionClear (env);
 
-}
-
-jclass 
-getJavaLangBooleanClass(JNIEnv * env){
-  jclass lookupClass = HARMONY_CACHE_GET(env,CLS_java_lang_Boolean);
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jmethodID
-getJavaLangBooleanInit(JNIEnv * env){
-  jmethodID mid;
-  mid = HARMONY_CACHE_GET(env,MID_java_lang_Boolean_init);;
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jfieldID
-getJavaLangBooleanValue(JNIEnv * env){
-  jmethodID mid;
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Boolean");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(Z)V");
-  if (!mid)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "value", "Z");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jclass
-getJavaLangByteClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Byte");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jmethodID
-getJavaLangByteInit(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Byte");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(B)V");
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jfieldID
-getJavaLangByteValue(JNIEnv * env){
-  jmethodID mid;
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Byte");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(B)V");
-  if (!mid)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "value", "B");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jclass
-getJavaLangIntegerClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Integer");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jmethodID
-getJavaLangIntegerInit(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Integer");
-  if (!lookupClass)
-    return NULL;
-  mid =  (*env)->GetMethodID (env, lookupClass, "<init>", "(I)V");
-  return mid;
-}
-
-jfieldID
-getJavaLangIntegerValue(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Integer");
-  if (!lookupClass)
-    return NULL;
-  fid =  (*env)->GetFieldID (env, lookupClass, "value", "I");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-/* already impl
-jmethodID
-getJavaLangByteInit(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Integer");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(I)V");
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jfieldID
-getJavaLangByteValue(JNIEnv * env){
-  jmethodID mid;
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Integer");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "(I)V");
-  if (!mid)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "value", "I");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-*/
-
-jclass
-getJavaNetInetAddressClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jfieldID
-getJavaNetInetAddressIpaddress(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "ipaddress", "[B");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jmethodID
-getJavaNetInetAddressPreferIPv6Addresses(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetStaticMethodID (env, lookupClass, "preferIPv6Addresses",
-             "()Z");
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jmethodID
-getJavaNetInetAddressGetByAddressStringByte(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  mid =
-        (*env)->GetStaticMethodID (env, lookupClass, "getByAddress",
-        "(Ljava/lang/String;[B)Ljava/net/InetAddress;");
-  if (!mid)
-        return NULL;
-  return mid;
-}
-
-jmethodID
-getJavaNetInetAddressGetByAddressByteArray(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  mid =
-        (*env)->GetStaticMethodID (env, lookupClass, "getByAddress",
-        "([B)Ljava/net/InetAddress;");
-  if (!mid)
-        return NULL;
-  return mid;
-}
-jmethodID
-getJavaNetInetAddressInitByteArray(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>", "([B)V");
-  if (!mid)
-        return NULL;
-  return mid;
-}
-
-jmethodID
-getJavaNetInetAddressInitByteString(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/InetAddress");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetMethodID (env, lookupClass, "<init>",
-        "([BLjava/lang/String;)V");
-  if (!mid)
-        return NULL;
-  return mid;
-}
-
-jclass
-getJavaNetSocketClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/net/Socket");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jmethodID
-getJavaNetSocketPreferIPv4Stack(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/Socket");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetStaticMethodID (env, lookupClass, "preferIPv4Stack", "()Z");
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jclass
-getJavaLangThreadClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Thread");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jmethodID
-getJavaLangThreadYield(JNIEnv * env){
-  jmethodID mid;
-  jclass lookupClass = (*env)->FindClass (env, "java/lang/Thread");
-  if (!lookupClass)
-    return NULL;
-  mid = (*env)->GetStaticMethodID (env, lookupClass, "yield", "()V");
-  if (!mid)
-    return NULL;
-  return mid;
-}
-
-jclass
-getJavaNetDatagramPacketClass(JNIEnv * env){
-  jclass lookupClass = (*env)->FindClass (env, "java/net/DatagramPacket");
-  if (!lookupClass)
-    return NULL;
-  return lookupClass;
-}
-
-jfieldID
-getJavaNetDatagramPacketAddress(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/DatagramPacket");
-  if (!lookupClass)
-    return NULL;
-  fid =
-    (*env)->GetFieldID (env, lookupClass, "address",
-      "Ljava/net/InetAddress;");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jfieldID
-getJavaNetDatagramPacketLength(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/DatagramPacket");
-  if (!lookupClass)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "length", "I");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jfieldID
-getJavaNetDatagramPacketPort(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/DatagramPacket");
-  if (!lookupClass)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "port", "I");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-
-jfieldID
-getJavaNetSocketImplAddress(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/SocketImpl");
-  if (!lookupClass)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "address", "Ljava/net/InetAddress;");
-  if (!fid)
-    return NULL;
-  return fid;
-}
-jfieldID
-getJavaNetSocketImplPort(JNIEnv * env){
-  jfieldID fid;
-  jclass lookupClass = (*env)->FindClass (env, "java/net/SocketImpl");
-  if (!lookupClass)
-    return NULL;
-  fid = (*env)->GetFieldID (env, lookupClass, "port", "I");
-  if (!fid)
-    return NULL;
-  return fid;
 }
 
 jfieldID

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.h?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.h (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/nethelp.h Sun Sep 16 14:56:42 2007
@@ -83,83 +83,6 @@
 I_32 netGetSockAddr (JNIEnv * env, jobject fileDescriptor,
          hysockaddr_t sockaddrP, jboolean preferIPv6Addresses);
          
-         jclass 
-getJavaLangBooleanClass(JNIEnv * env);
-
-jmethodID
-getJavaLangBooleanInit(JNIEnv * env);
-
-jfieldID
-getJavaLangBooleanValue(JNIEnv * env);
-
-jclass
-getJavaLangByteClass(JNIEnv * env);
-
-jmethodID
-getJavaLangByteInit(JNIEnv * env);
-
-jfieldID
-getJavaLangByteValue(JNIEnv * env);
-
-jclass
-getJavaLangIntegerClass(JNIEnv * env);
-
-jmethodID
-getJavaLangIntegerInit(JNIEnv * env);
-
-jfieldID
-getJavaLangIntegerValue(JNIEnv * env);
-
-jclass
-getJavaNetInetAddressClass(JNIEnv * env);
-
-jfieldID
-getJavaNetInetAddressIpaddress(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressPreferIPv6Addresses(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressGetByAddressStringByte(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressGetByAddressByteArray(JNIEnv * env);
-jmethodID
-getJavaNetInetAddressInitByteArray(JNIEnv * env);
-
-jmethodID
-getJavaNetInetAddressInitByteString(JNIEnv * env);
-
-jclass
-getJavaNetSocketClass(JNIEnv * env);
-
-jmethodID
-getJavaNetSocketPreferIPv4Stack(JNIEnv * env);
-
-jclass
-getJavaLangThreadClass(JNIEnv * env);
-
-jmethodID
-getJavaLangThreadYield(JNIEnv * env);
-
-jclass
-getJavaNetDatagramPacketClass(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketAddress(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketLength(JNIEnv * env);
-
-jfieldID
-getJavaNetDatagramPacketPort(JNIEnv * env);
-
-jfieldID
-getJavaNetSocketImplAddress(JNIEnv * env);
-
-jfieldID
-getJavaNetSocketImplPort(JNIEnv * env);
-
 void
 setJavaIoFileDescriptorContents (JNIEnv * env, jobject fd,
                                           void *value);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/ois.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/ois.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/ois.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/ois.c Sun Sep 16 14:56:42 2007
@@ -174,7 +174,14 @@
     }
   else
     {
-      return (jobject) (*env)->NewObject (env, instantiationClass, mid);        /* Instantiate an object of a given class */
+      /* Instantiate an object of a given class and constuct it using
+         the constructor of the other class. */
+      jobject obj;
+      obj = (*env)->AllocObject(env, instantiationClass);
+      if (obj != NULL) {
+        (*env)->CallVoidMethod(env, obj, mid);
+      }
+      return obj;
     }
 
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/proxy.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/proxy.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/proxy.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/proxy.c Sun Sep 16 14:56:42 2007
@@ -47,7 +47,7 @@
 
   returnClass = (*env)->DefineClass (env, name, classLoader, bytes, length);
 
-  (*env)->ReleaseByteArrayElements (env, classBytes, bytes, JNI_COMMIT);
+  (*env)->ReleaseByteArrayElements (env, classBytes, bytes, JNI_ABORT);
   (*env)->ReleaseStringUTFChars (env, className, name);
   return returnClass;
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/socket.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/socket.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/socket.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/shared/socket.c Sun Sep 16 14:56:42 2007
@@ -266,7 +266,7 @@
   PORT_ACCESS_FROM_ENV (env);
   I_32 result;
   U_8 nipmcast[HYSOCK_INADDR6_LEN], nipInterface[HYSOCK_INADDR6_LEN];
-  U_32 length, lengthIF = HYSOCK_INADDR_LEN;
+  U_32 length, lengthIF;
   hyipmreq_struct ipmreqP;
   hysockaddr_struct sockaddrP;
   hyipv6_mreq_struct ipv6Mreq;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c Sun Sep 16 14:56:42 2007
@@ -57,6 +57,7 @@
 
 JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_isReachableByICMPImpl
   (JNIEnv * env, jobject clz, jobject address, jobject localaddr,  jint ttl, jint timeout){
+  PORT_ACCESS_FROM_ENV (env);
   struct sockaddr_in dest,source,local;
   struct icmp * send_buf = 0;
   struct ip * recv_buf = 0;
@@ -64,7 +65,7 @@
   struct pollfd my_pollfd;
   int sockadd_size = sizeof (source);
   jbyte host[HYSOCK_INADDR6_LEN];
-  U_32 length =  (*env)->GetArrayLength (env,address);
+  U_32 length;
 
   int sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
   if (INVALID_SOCKET == sock){
@@ -93,11 +94,15 @@
     bind(sock, (struct sockaddr *)& local, sizeof(local));
   }
 
-  send_buf = (struct icmp*)malloc(sizeof(char)*ICMP_SIZE);
-  recv_buf = (struct ip*)malloc(sizeof(char)*PACKET_SIZE);
-  if (NULL == send_buf || NULL == recv_buf){
-	  ret = NOPRIVILEGE;
-      goto cleanup;
+  send_buf = (struct icmp*)hymem_allocate_memory(sizeof(char)*ICMP_SIZE);
+  if (NULL == send_buf) {
+    ret = NOPRIVILEGE;
+    goto cleanup;
+  }
+  recv_buf = (struct ip*)hymem_allocate_memory(sizeof(char)*PACKET_SIZE);
+  if (NULL == recv_buf) {
+    ret = NOPRIVILEGE;
+    goto cleanup;
   }
   set_icmp_packet(send_buf, ICMP_SIZE);
 
@@ -138,11 +143,11 @@
 cleanup:
 
   if (send_buf != NULL) {
-      free(send_buf);
+      hymem_free_memory(send_buf);
   }
 
   if (recv_buf != NULL) {
-      free(recv_buf);
+      hymem_free_memory(recv_buf);
   }
 
   return ret;
@@ -208,6 +213,7 @@
   for (val=0; val<countReadC; val++) {
 	  gotFD	= (*env)->GetObjectArrayElement(env, readFDArray, val);
 	  hysocketP = getJavaIoFileDescriptorContentsAsAPointer	(env, gotFD);
+      (*env)->DeleteLocalRef(env, gotFD);
 
       my_pollfds[val].fd = hysocketP->sock;
       my_pollfds[val].events = POLLIN | POLLPRI;
@@ -217,6 +223,7 @@
   for (val=0; val<countWriteC; val++) {
 	  gotFD	= (*env)->GetObjectArrayElement(env, writeFDArray, val);
 	  hysocketP = getJavaIoFileDescriptorContentsAsAPointer	(env, gotFD);
+      (*env)->DeleteLocalRef(env, gotFD);
 
       my_pollfds[countReadC + val].fd = hysocketP->sock;
       my_pollfds[countReadC + val].events = POLLOUT;
@@ -253,6 +260,7 @@
 
 JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl
   (JNIEnv * env , jobject clz){
+    PORT_ACCESS_FROM_ENV (env);
     int socket = 0;
     int opt;
     int length = sizeof(opt);
@@ -283,7 +291,7 @@
 		if(AF_INET != local_addr.sin_family || length != sizeof(struct sockaddr)){
 			return NULL;
 		}
-		localAddr = malloc(sizeof(jbyte)*4);
+		localAddr = hymem_allocate_memory(sizeof(jbyte)*4);
 		if (NULL == localAddr){
 			return NULL;
 		}
@@ -292,16 +300,26 @@
 	if(0 != getpeername(socket,(struct sockaddr *)&remote_addr,(unsigned int *)&length))	{
 		remote_addr.sin_port = 0;
                 remote_addr.sin_addr.s_addr = 0;
-		address = malloc(sizeof(jbyte)*4);
+		address = hymem_allocate_memory(sizeof(jbyte)*4);
+                if (NULL == address) {
+                  goto clean;
+                }
 		bzero(address,sizeof(jbyte)*4);
 	} else {
 		if(AF_INET != remote_addr.sin_family || length != sizeof(struct sockaddr))	{
 			return NULL;
 		}
-		address = malloc(sizeof(jbyte)*4);
+		address = hymem_allocate_memory(sizeof(jbyte)*4);
+                if (NULL == address) {
+                  goto clean;
+                }
 		memcpy (address, &(remote_addr.sin_addr.s_addr), 4);
 	}
-	sock = malloc(sizeof(hysocket_struct));
+	sock = hymem_allocate_memory(sizeof(hysocket_struct));
+        /* TODO: where is sock free'd? */
+        if (NULL == sock) {
+          goto clean;
+        }
 	sock->sock = socket;
 	sock->family = AF_INET;
 
@@ -312,10 +330,12 @@
 		//socket
 		channel_class = (*env)->FindClass(env,"org/apache/harmony/nio/internal/SocketChannelImpl");
         	if(NULL == channel_class) {
+                    hymem_free_memory(sock);
         	    goto clean;
 	        }
 		channel_object = getJavaNioChannelsSocketChannelImplObj(env,channel_class);
           	if(NULL == channel_object) {
+                    hymem_free_memory(sock);
 	            goto clean;
         	}
 		// new and set FileDescript
@@ -338,6 +358,8 @@
 			(*env)->SetBooleanField(env,channel_object, bound_field,jtrue);
 		}
 	  } else {
+                // sock isn't used on this code path so we should free it
+                hymem_free_memory(sock);
 		//serverSocket	
 		channel_class = (*env)->FindClass(env,"org/apache/harmony/nio/internal/ServerSocketChannelImpl");
         	if(NULL == channel_class) {
@@ -376,10 +398,12 @@
 	  // new DatagramChannel
 	  channel_class = (*env)->FindClass(env,"org/apache/harmony/nio/internal/DatagramChannelImpl");
           if(NULL == channel_class) {
+              hymem_free_memory(sock);
               goto clean;
           }
           channel_object = getJavaNioChannelsSocketChannelImplObj(env,channel_class);
           if(NULL == channel_object) {
+              hymem_free_memory(sock);
               goto clean;
           }
 	  // new and set FileDescript
@@ -393,9 +417,8 @@
 		(*env)->SetBooleanField(env,channel_object, bound_field,jtrue);			
 	  }
         }	
-clean:
-	free(address);
-	free(localAddr);
+ clean:
+	hymem_free_memory(address);
+	hymem_free_memory(localAddr);
 	return channel_object;
 }
-

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c Sun Sep 16 14:56:42 2007
@@ -59,6 +59,8 @@
   for (val = 0; val<countReadC; val++){
 	  gotFD	= (*env)->GetObjectArrayElement(env,readFDArray,val);
 	  hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+      (*env)->DeleteLocalRef(env, gotFD);
+
 	  if (!hysock_socketIsValid (hysocketP)){
       		continue;
     	  }
@@ -78,6 +80,8 @@
   for (val = 0; val<countWriteC; val++){
 	  gotFD	= (*env)->GetObjectArrayElement(env,writeFDArray,val);
 	  hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+      (*env)->DeleteLocalRef(env, gotFD);
+
 	  if (!hysock_socketIsValid (hysocketP)){
       		continue;
     	  }
@@ -119,6 +123,8 @@
 	  for (val=0;val<countReadC;val++){
 		gotFD =	(*env)->GetObjectArrayElement(env,readFDArray,val);
 		hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+        (*env)->DeleteLocalRef(env, gotFD);
+
 		if (!hysock_socketIsValid (hysocketP)){
       			continue;
     	  	}
@@ -141,6 +147,8 @@
 	  for (val=0;val<countWriteC;val++){
 		gotFD =	(*env)->GetObjectArrayElement(env,writeFDArray,val);
 		hysocketP = getJavaIoFileDescriptorContentsAsPointer (env, gotFD);
+        (*env)->DeleteLocalRef(env, gotFD);
+
 		if (!hysock_socketIsValid (hysocketP)){
       			continue;
     	  	}
@@ -206,6 +214,7 @@
  */
 JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_isReachableByICMPImpl
   (JNIEnv * env, jobject clz, jobject address,jobject localaddr, jint ttl, jint timeout){
+  PORT_ACCESS_FROM_ENV (env);
   struct sockaddr_in dest,source,local;
   struct ICMPHeader* send_buf = 0;
   struct IPHeader* recv_buf = 0;
@@ -220,7 +229,7 @@
   struct ICMPHeader* icmphdr;
   struct WSAData wsaData;
   int ret = UNREACHABLE;
-  U_32 length =  (*env)->GetArrayLength (env,address);
+  U_32 length;
 	      
   // start raw socket, return -1 for privilege can not be obtained
   if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
@@ -254,9 +263,12 @@
   }
   
   // set basic send and recv buf
-  send_buf = (struct ICMPHeader*)malloc(sizeof(char)*ICMP_SIZE);
-  recv_buf = (struct IPHeader*)malloc(sizeof(char)*PACKET_SIZE);
-  if (NULL == send_buf || NULL == recv_buf){
+  send_buf = (struct ICMPHeader*)hymem_allocate_memory(sizeof(char)*ICMP_SIZE);
+  if (NULL == send_buf) {
+	  goto cleanup;
+  }
+  recv_buf = (struct IPHeader*)hymem_allocate_memory(sizeof(char)*PACKET_SIZE);
+  if (NULL == recv_buf){
 	  goto cleanup;
   }
   set_icmp_packet(send_buf, ICMP_SIZE);
@@ -265,7 +277,7 @@
             (struct sockaddr*)&dest, sizeof(dest))){
 	  goto cleanup;
   }
-  fdset_read = (fd_set *)malloc(sizeof (struct fd_set));
+  fdset_read = (fd_set *)hymem_allocate_memory(sizeof (struct fd_set));
   if (NULL == fdset_read){
   	  goto cleanup;
   }
@@ -296,9 +308,9 @@
   }
   ret = REACHABLE;
 cleanup:
-  free(fdset_read);
-  free(send_buf);
-  free(recv_buf);
+  hymem_free_memory(fdset_read);
+  hymem_free_memory(send_buf);
+  hymem_free_memory(recv_buf);
   WSACleanup();	 
   return ret;
 }
@@ -306,7 +318,7 @@
 // typical ip checksum
 unsigned short ip_checksum(unsigned short * buffer, int size)
 {
-	register unsigned short * buf = buffer;
+    register unsigned short * buf = buffer;
     register int bufleft = size;
     register unsigned long sum = 0;
     

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/HashMapTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/HashMapTest.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/HashMapTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/tests/api/java/util/HashMapTest.java Sun Sep 16 14:56:42 2007
@@ -501,6 +501,39 @@
             return new MockClonable(i);
         }
     }
+    
+    /*
+     * Regression test for HY-4750
+     */
+    public void test_EntrySet() {
+        HashMap map = new HashMap();
+        map.put(new Integer(1), "ONE");
+
+        Set entrySet = map.entrySet();
+        Iterator e = entrySet.iterator();
+        Object real = e.next();
+        Map.Entry copyEntry = new MockEntry();
+        assertEquals(real, copyEntry);
+        assertTrue(entrySet.contains(copyEntry));
+        
+        entrySet.remove(copyEntry);
+        assertFalse(entrySet.contains(copyEntry));
+    }
+
+    private static class MockEntry implements Map.Entry {
+
+        public Object getKey() {
+            return new Integer(1);
+        }
+
+        public Object getValue() {
+            return "ONE";
+        }
+
+        public Object setValue(Object object) {
+            return null;
+        }
+    }
 	
 	/**
 	 * Sets up the fixture, for example, open a network connection. This method

Modified: harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/math/src/main/java/java/math/BigInteger.java Sun Sep 16 14:56:42 2007
@@ -25,14 +25,9 @@
 
 import org.apache.harmony.math.internal.nls.Messages;
 
-/**
- * @author Intel Middleware Product Division
- * @author Instituto Tecnologico de Cordoba
- */
 public class BigInteger extends Number implements Comparable<BigInteger>,
         Serializable {
 
-    /** @ar.org.fitc.spec_ref */
     private static final long serialVersionUID = -8287574255936472291L;
 
     /* Fields used for the internal representation. */
@@ -46,15 +41,10 @@
     /** The sign of this. */
     transient int sign;
 
-    /* Static Fields */
-
-    /** @ar.org.fitc.spec_ref */
     public static final BigInteger ONE = new BigInteger(1, 1);
 
-    /** @ar.org.fitc.spec_ref */
     public static final BigInteger TEN = new BigInteger(1, 10);
 
-    /** @ar.org.fitc.spec_ref */
     public static final BigInteger ZERO = new BigInteger(0, 0);
 
     /** The {@code BigInteger} constant -1. */
@@ -75,22 +65,18 @@
             new BigInteger(1, 6), new BigInteger(1, 7), new BigInteger(1, 8),
             new BigInteger(1, 9), TEN };
 
-    /**/
     private transient int firstNonzeroDigit = -2;
-    
+
     /* Serialized Fields */
 
-    /** @ar.org.fitc.spec_ref */
     private int signum;
 
-    /** @ar.org.fitc.spec_ref */
     private byte[] magnitude;
-    
+
     private transient int hashCode = 0;
 
     /* Public Constructors */
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(int numBits, Random rnd) {
         if (numBits < 0) {
             // math.1B=numBits must be non-negative
@@ -113,7 +99,6 @@
         }
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(int bitLength, int certainty, Random rnd) {
         if (bitLength < 2) {
             // math.1C=bitLength < 2
@@ -125,12 +110,10 @@
         digits = me.digits;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(String val) {
         this(val, 10);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(String val, int radix) {
         if (val == null) {
             throw new NullPointerException();
@@ -143,10 +126,9 @@
             // math.12=Zero length BigInteger
             throw new NumberFormatException(Messages.getString("math.12")); //$NON-NLS-1$
         }
-        setFromString(this, val, radix);        
+        setFromString(this, val, radix);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(int signum, byte[] magnitude) {
         if (magnitude == null) {
             throw new NullPointerException();
@@ -159,7 +141,8 @@
             for (byte element : magnitude) {
                 if (element != 0) {
                     // math.14=signum-magnitude mismatch
-                    throw new NumberFormatException(Messages.getString("math.14")); //$NON-NLS-1$
+                    throw new NumberFormatException(Messages
+                            .getString("math.14")); //$NON-NLS-1$
                 }
             }
         }
@@ -174,7 +157,6 @@
         }
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger(byte[] val) {
         if (val.length == 0) {
             // math.12=Zero length BigInteger
@@ -192,10 +174,13 @@
 
     /* Package Constructors */
 
-    /** 
+    /**
      * Constructs a number which array is of size 1.
-     * @param sign the sign of the number
-     * @param value the only one digit of array 
+     * 
+     * @param sign
+     *            the sign of the number
+     * @param value
+     *            the only one digit of array
      */
     BigInteger(int sign, int value) {
         this.sign = sign;
@@ -203,13 +188,16 @@
         digits = new int[] { value };
     }
 
-    /** 
-     * Constructs a number without to create new space.
-     * This construct should be used only if the three fields 
-     * of representation are known. 
-     * @param sign the sign of the number
-     * @param numberLength the length of the internal array
-     * @param digits a reference of some array created before 
+    /**
+     * Constructs a number without to create new space. This construct should be
+     * used only if the three fields of representation are known.
+     * 
+     * @param sign
+     *            the sign of the number
+     * @param numberLength
+     *            the length of the internal array
+     * @param digits
+     *            a reference of some array created before
      */
     BigInteger(int sign, int numberLength, int[] digits) {
         this.sign = sign;
@@ -218,13 +206,16 @@
     }
 
     /**
-     * Creates a new {@code BigInteger} whose value is equal to the
-     * specified {@code long}.
-     * @param sign the sign of the number
-     * @param val the value of the new {@code BigInteger}.
+     * Creates a new {@code BigInteger} whose value is equal to the specified
+     * {@code long}.
+     * 
+     * @param sign
+     *            the sign of the number
+     * @param val
+     *            the value of the new {@code BigInteger}.
      */
     BigInteger(int sign, long val) {
-        //PRE: (val >= 0) && (sign >= -1) && (sign <= 1)
+        // PRE: (val >= 0) && (sign >= -1) && (sign <= 1)
         this.sign = sign;
         if ((val & 0xFFFFFFFF00000000L) == 0) {
             // It fits in one 'int'
@@ -237,11 +228,14 @@
     }
 
     /**
-     * Creates a new {@code BigInteger} with the given sign and magnitude. 
-     * This constructor does not create a copy, so any changes to the 
-     * reference will affect the new number.
-     * @param signum The sign of the number represented by {@code digits}
-     * @param digits The magnitude of the number
+     * Creates a new {@code BigInteger} with the given sign and magnitude. This
+     * constructor does not create a copy, so any changes to the reference will
+     * affect the new number.
+     * 
+     * @param signum
+     *            The sign of the number represented by {@code digits}
+     * @param digits
+     *            The magnitude of the number
      */
     BigInteger(int signum, int digits[]) {
         if (digits.length == 0) {
@@ -256,12 +250,9 @@
         }
     }
 
-    /* Public Methods */
-
-    /** @ar.org.fitc.spec_ref */
     public static BigInteger valueOf(long val) {
         if (val < 0) {
-            if(val != -1) {
+            if (val != -1) {
                 return new BigInteger(-1, -val);
             }
             return MINUS_ONE;
@@ -271,19 +262,19 @@
             return new BigInteger(1, val);
         }
     }
-    
 
-    /** @ar.org.fitc.spec_ref */
     public byte[] toByteArray() {
-        if( this.sign == 0 ){
-            return new byte[]{0};
+        if (this.sign == 0) {
+            return new byte[] { 0 };
         }
         BigInteger temp = this;
         int bitLen = bitLength();
         int iThis = getFirstNonzeroDigit();
         int bytesLen = (bitLen >> 3) + 1;
-        /* Puts the little-endian int array representing the magnitude
-         * of this BigInteger into the big-endian byte array. */
+        /*
+         * Puts the little-endian int array representing the magnitude of this
+         * BigInteger into the big-endian byte array.
+         */
         byte[] bytes = new byte[bytesLen];
         int firstByteNumber = 0;
         int highBytes;
@@ -300,23 +291,23 @@
             hB = bytesLen & 3;
             highBytes = (hB == 0) ? 4 : hB;
         }
-        
+
         digitIndex = iThis;
         bytesLen -= iThis << 2;
-        
+
         if (sign < 0) {
             digit = -temp.digits[digitIndex];
             digitIndex++;
-            if(digitIndex == numberLength){
+            if (digitIndex == numberLength) {
                 bytesInInteger = highBytes;
             }
             for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {
                 bytes[--bytesLen] = (byte) digit;
             }
-            while( bytesLen > firstByteNumber ){
+            while (bytesLen > firstByteNumber) {
                 digit = ~temp.digits[digitIndex];
                 digitIndex++;
-                if(digitIndex == numberLength){
+                if (digitIndex == numberLength) {
                     bytesInInteger = highBytes;
                 }
                 for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {
@@ -324,20 +315,20 @@
                 }
             }
         } else {
-        while (bytesLen > firstByteNumber) {
-            digit = temp.digits[digitIndex];
-            digitIndex++;
-            if (digitIndex == numberLength) {
-                bytesInInteger = highBytes;
-            }
-            for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {
-                bytes[--bytesLen] = (byte) digit;
+            while (bytesLen > firstByteNumber) {
+                digit = temp.digits[digitIndex];
+                digitIndex++;
+                if (digitIndex == numberLength) {
+                    bytesInInteger = highBytes;
+                }
+                for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {
+                    bytes[--bytesLen] = (byte) digit;
+                }
             }
         }
-        }
         return bytes;
     }
-    
+
     /** @see BigInteger#BigInteger(String, int) */
     private static void setFromString(BigInteger bi, String val, int radix) {
         int sign;
@@ -376,7 +367,7 @@
         // Parse an input string and accumulate the BigInteger's magnitude
         int digitIndex = 0; // index of digits array
         int substrEnd = startChar + ((topChars == 0) ? charsPerInt : topChars);
-        int newDigit;        
+        int newDigit;
 
         for (int substrStart = startChar; substrStart < endChar; substrStart = substrEnd, substrEnd = substrStart
                 + charsPerInt) {
@@ -392,37 +383,30 @@
         bi.sign = sign;
         bi.numberLength = numberLength;
         bi.digits = digits;
-        bi.cutOffLeadingZeroes();        
+        bi.cutOffLeadingZeroes();
     }
 
-
-    /** @ar.org.fitc.spec_ref */
     public BigInteger abs() {
         return ((sign < 0) ? new BigInteger(1, numberLength, digits) : this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger negate() {
         return ((sign == 0) ? this
                 : new BigInteger(-sign, numberLength, digits));
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger add(BigInteger val) {
         return Elementary.add(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger subtract(BigInteger val) {
         return Elementary.subtract(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public int signum() {
         return sign;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger shiftRight(int n) {
         if ((n == 0) || (sign == 0)) {
             return this;
@@ -431,7 +415,6 @@
                 this, -n));
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger shiftLeft(int n) {
         if ((n == 0) || (sign == 0)) {
             return this;
@@ -440,12 +423,10 @@
                 this, -n));
     }
 
-    /** @ar.org.fitc.spec_ref */
     public int bitLength() {
         return BitLevel.bitLength(this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public boolean testBit(int n) {
         if (n == 0) {
             return ((digits[0] & 1) != 0);
@@ -459,40 +440,34 @@
             return (sign < 0);
         }
         int digit = digits[intCount];
-        int i;
         n = (1 << (n & 31)); // int with 1 set to the needed position
         if (sign < 0) {
             int firstNonZeroDigit = getFirstNonzeroDigit();
-            if (  intCount < firstNonZeroDigit  ){
+            if (intCount < firstNonZeroDigit) {
                 return false;
-            }else if( firstNonZeroDigit == intCount ){
+            } else if (firstNonZeroDigit == intCount) {
                 digit = -digit;
-            }else{
+            } else {
                 digit = ~digit;
             }
         }
         return ((digit & n) != 0);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger setBit(int n) {
-        if( !testBit( n ) ){
+        if (!testBit(n)) {
             return BitLevel.flipBit(this, n);
-        }else{
-            return this;
         }
+        return this;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger clearBit(int n) {
-        if( testBit( n ) ){
+        if (testBit(n)) {
             return BitLevel.flipBit(this, n);
-        }else{
-            return this;
         }
+        return this;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger flipBit(int n) {
         if (n < 0) {
             // math.15=Negative bit address
@@ -501,53 +476,44 @@
         return BitLevel.flipBit(this, n);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public int getLowestSetBit() {
         if (sign == 0) {
             return -1;
         }
-        // (sign != 0)  implies that exists some non zero digit 
+        // (sign != 0) implies that exists some non zero digit
         int i = getFirstNonzeroDigit();
         return ((i << 5) + Integer.numberOfTrailingZeros(digits[i]));
     }
 
-    /** @ar.org.fitc.spec_ref */
     public int bitCount() {
         return BitLevel.bitCount(this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger not() {
         return Logical.not(this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger and(BigInteger val) {
         return Logical.and(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger or(BigInteger val) {
         return Logical.or(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger xor(BigInteger val) {
         return Logical.xor(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger andNot(BigInteger val) {
         return Logical.andNot(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public int intValue() {
         return (sign * digits[0]);
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public long longValue() {
         long value = (numberLength > 1) ? (((long) digits[1]) << 32)
@@ -555,19 +521,16 @@
         return (sign * value);
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public float floatValue() {
         return (float) doubleValue();
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public double doubleValue() {
         return Conversion.bigInteger2Double(this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public int compareTo(BigInteger val) {
         if (sign > val.sign) {
             return GREATER;
@@ -581,69 +544,61 @@
         if (numberLength < val.numberLength) {
             return -val.sign;
         }
-        // Equal sign and equal numberLength 
+        // Equal sign and equal numberLength
         return (sign * Elementary.compareArrays(digits, val.digits,
                 numberLength));
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger min(BigInteger val) {
         return ((this.compareTo(val) == LESS) ? this : val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger max(BigInteger val) {
         return ((this.compareTo(val) == GREATER) ? this : val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public int hashCode() {
-    	if (hashCode != 0) {
-    	    return hashCode;	
-    	}    	  
-    	for (int i = 0; i < digits.length; i ++) {
-    		hashCode = (int)(hashCode * 33 + (digits[i] & 0xffffffff));    		
-    	}  
-    	hashCode = hashCode * sign;
+        if (hashCode != 0) {
+            return hashCode;
+        }
+        for (int i = 0; i < digits.length; i++) {
+            hashCode = (hashCode * 33 + (digits[i] & 0xffffffff));
+        }
+        hashCode = hashCode * sign;
         return hashCode;
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public boolean equals(Object x) {
-    	if (this == x) {
-		    return true;
-	    }
-	    if (x instanceof BigInteger) {
-		    BigInteger x1 = (BigInteger)x;            
-            return sign == x1.sign 
-                   && numberLength == x1.numberLength 
-                   && equalsArrays(x1.digits);    		
-	    }
+        if (this == x) {
+            return true;
+        }
+        if (x instanceof BigInteger) {
+            BigInteger x1 = (BigInteger) x;
+            return sign == x1.sign && numberLength == x1.numberLength
+                    && equalsArrays(x1.digits);
+        }
         return false;
-    } 
+    }
 
     boolean equalsArrays(final int[] b) {
-        int i;        
+        int i;
         for (i = numberLength - 1; (i >= 0) && (digits[i] == b[i]); i--) {
-            ;
-        }        
+            // Empty
+        }
         return i < 0;
     }
 
-    /** @ar.org.fitc.spec_ref */
     @Override
     public String toString() {
         return Conversion.toDecimalScaledString(this, 0);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public String toString(int radix) {
         return Conversion.bigInteger2String(this, radix);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger gcd(BigInteger val) {
         BigInteger val1 = this.abs();
         BigInteger val2 = val.abs();
@@ -653,21 +608,19 @@
         } else if (val2.signum() == 0) {
             return val1;
         }
-        	
+
         // Optimization for small operands
         // (op2.bitLength() < 64) and (op1.bitLength() < 64)
-    	if ((( val1.numberLength == 1 )
-    			|| ( ( val1.numberLength == 2 ) && ( val1.digits[1] > 0 ) ))
-            && (val2.numberLength == 1 || (val2.numberLength == 2 && val2.digits[1] > 0) )) {
-                return BigInteger.valueOf(Division.gcdBinary(val1.longValue(),
-                        val2.longValue()));
+        if (((val1.numberLength == 1) || ((val1.numberLength == 2) && (val1.digits[1] > 0)))
+                && (val2.numberLength == 1 || (val2.numberLength == 2 && val2.digits[1] > 0))) {
+            return BigInteger.valueOf(Division.gcdBinary(val1.longValue(), val2
+                    .longValue()));
         }
-    	
+
         return Division.gcdBinary(val1.copy(), val2.copy());
-    
+
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger multiply(BigInteger val) {
         // This let us to throw NullPointerException when val == null
         if (val.sign == 0) {
@@ -679,22 +632,31 @@
         return Multiplication.multiply(this, val);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger pow(int exp) {
-        if (exp < 0){
+        if (exp < 0) {
             // math.16=Negative exponent
             throw new ArithmeticException(Messages.getString("math.16")); //$NON-NLS-1$
         }
         if (exp == 0) {
             return ONE;
-        } else if(exp == 1 || equals(ONE) || equals(ZERO)) {
+        } else if (exp == 1 || equals(ONE) || equals(ZERO)) {
             return this;
         }
+
+        // if even take out 2^x factor which we can
+        // calculate by shifting.
+        if (!testBit(0)) {
+            int x = 1;
+            BigInteger factor = BigInteger.ONE.shiftLeft(exp);
+            while (!testBit(x)) {
+                factor = factor.shiftLeft(exp);
+                x++;
+            }
+            return factor.multiply(this.shiftRight(x).pow(exp));
+        }
         return Multiplication.pow(this, exp);
-        
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger[] divideAndRemainder(BigInteger divisor) {
         int divisorSign = divisor.sign;
         if (divisorSign == 0) {
@@ -720,9 +682,8 @@
         int remainderLength = divisorLen;
         int quotientSign = ((thisSign == divisorSign) ? 1 : -1);
         int quotientDigits[] = new int[quotientLength];
-        int remainderDigits[] = Division.divide(quotientDigits,
-                quotientLength, thisDigits, thisLen, divisorDigits,
-                divisorLen);
+        int remainderDigits[] = Division.divide(quotientDigits, quotientLength,
+                thisDigits, thisLen, divisorDigits, divisorLen);
         BigInteger result0 = new BigInteger(quotientSign, quotientLength,
                 quotientDigits);
         BigInteger result1 = new BigInteger(thisSign, remainderLength,
@@ -732,7 +693,6 @@
         return new BigInteger[] { result0, result1 };
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger divide(BigInteger divisor) {
         if (divisor.sign == 0) {
             // math.17=BigInteger divide by zero
@@ -753,8 +713,8 @@
             }
             return valueOf(val);
         }
-        int cmp = ((thisLen != divisorLen) ? ((thisLen > divisorLen) ? 1 : -1) : Elementary
-                .compareArrays(digits, divisor.digits, thisLen));
+        int cmp = ((thisLen != divisorLen) ? ((thisLen > divisorLen) ? 1 : -1)
+                : Elementary.compareArrays(digits, divisor.digits, thisLen));
         if (cmp == EQUALS) {
             return ((thisSign == divisorSign) ? ONE : MINUS_ONE);
         }
@@ -765,16 +725,17 @@
         int resDigits[] = new int[resLength];
         int resSign = ((thisSign == divisorSign) ? 1 : -1);
         if (divisorLen == 1) {
-            Division.divideArrayByInt(resDigits, digits, thisLen, divisor.digits[0]);
+            Division.divideArrayByInt(resDigits, digits, thisLen,
+                    divisor.digits[0]);
         } else {
-            Division.divide(resDigits, resLength, digits, thisLen, divisor.digits, divisorLen);
+            Division.divide(resDigits, resLength, digits, thisLen,
+                    divisor.digits, divisorLen);
         }
         BigInteger result = new BigInteger(resSign, resLength, resDigits);
         result.cutOffLeadingZeroes();
         return result;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger remainder(BigInteger divisor) {
         if (divisor.sign == 0) {
             // math.17=BigInteger divide by zero
@@ -801,45 +762,43 @@
         return result;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger modInverse(BigInteger m) {
         if (m.sign <= 0) {
             // math.18=BigInteger: modulus not positive
             throw new ArithmeticException(Messages.getString("math.18")); //$NON-NLS-1$
         }
         // If both are even, no inverse exists
-        if (!( testBit(0) || m.testBit(0) )) {
+        if (!(testBit(0) || m.testBit(0))) {
             // math.19=BigInteger not invertible.
             throw new ArithmeticException(Messages.getString("math.19")); //$NON-NLS-1$
         }
         if (m.isOne()) {
             return ZERO;
         }
-        
+
         // From now on: (m > 1)
         BigInteger res = Division.modInverseMontgomery(abs().mod(m), m);
         if (res.sign == 0) {
             // math.19=BigInteger not invertible.
             throw new ArithmeticException(Messages.getString("math.19")); //$NON-NLS-1$
         }
-        
-        res = ( ( sign < 0 ) ? m.subtract(res) : res );
+
+        res = ((sign < 0) ? m.subtract(res) : res);
         return res;
-        
+
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger modPow(BigInteger exponent, BigInteger m) {
         if (m.sign <= 0) {
             // math.18=BigInteger: modulus not positive
             throw new ArithmeticException(Messages.getString("math.18")); //$NON-NLS-1$
         }
         BigInteger base = this;
-        
-        if(m.isOne() | ( exponent.sign>0 & base.sign == 0)){
+
+        if (m.isOne() | (exponent.sign > 0 & base.sign == 0)) {
             return BigInteger.ZERO;
         }
-        if(base.sign==0 && exponent.sign == 0){
+        if (base.sign == 0 && exponent.sign == 0) {
             return BigInteger.ONE;
         }
         if (exponent.sign < 0) {
@@ -857,7 +816,6 @@
         return res;
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger mod(BigInteger m) {
         if (m.sign <= 0) {
             // math.18=BigInteger: modulus not positive
@@ -867,12 +825,10 @@
         return ((rem.sign < 0) ? rem.add(m) : rem);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public boolean isProbablePrime(int certainty) {
         return Primality.isProbablePrime(abs(), certainty);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public BigInteger nextProbablePrime() {
         if (sign < 0) {
             // math.1A=start < 0: {0}
@@ -881,7 +837,6 @@
         return Primality.nextProbablePrime(this);
     }
 
-    /** @ar.org.fitc.spec_ref */
     public static BigInteger probablePrime(int bitLength, Random rnd) {
         return new BigInteger(bitLength, 100, rnd);
     }
@@ -891,7 +846,7 @@
     /** Decreases {@code numberLength} if there are zero high elements. */
     final void cutOffLeadingZeroes() {
         while ((numberLength > 0) && (digits[--numberLength] == 0)) {
-            ;
+            // Empty
         }
         if (digits[numberLength++] == 0) {
             sign = 0;
@@ -926,7 +881,8 @@
     }
 
     /**
-     * Puts a big-endian byte array into a little-endian applying two complement.
+     * Puts a big-endian byte array into a little-endian applying two
+     * complement.
      */
     private void putBytesNegativeToIntegers(byte[] byteValues) {
         int bytesLen = byteValues.length;
@@ -934,15 +890,15 @@
         numberLength = (bytesLen >> 2) + ((highBytes == 0) ? 0 : 1);
         digits = new int[numberLength];
         int i = 0;
-        //Setting the sign
-        digits [numberLength -1] = -1;
+        // Setting the sign
+        digits[numberLength - 1] = -1;
         // Put bytes to the int array starting from the end of the byte array
         while (bytesLen > highBytes) {
             digits[i] = (byteValues[--bytesLen] & 0xFF)
                     | (byteValues[--bytesLen] & 0xFF) << 8
                     | (byteValues[--bytesLen] & 0xFF) << 16
                     | (byteValues[--bytesLen] & 0xFF) << 24;
-            if ( digits[i] != 0 ) {
+            if (digits[i] != 0) {
                 digits[i] = -digits[i];
                 firstNonzeroDigit = i;
                 i++;
@@ -958,14 +914,14 @@
             }
             i++;
         }
-        if( highBytes != 0 ){
+        if (highBytes != 0) {
             // Put the first bytes in the highest element of the int array
-            if ( firstNonzeroDigit != -2  ){
+            if (firstNonzeroDigit != -2) {
                 for (int j = 0; j < bytesLen; j++) {
                     digits[i] = (digits[i] << 8) | (byteValues[j] & 0xFF);
                 }
                 digits[i] = ~digits[i];
-            }else{
+            } else {
                 for (int j = 0; j < bytesLen; j++) {
                     digits[i] = (digits[i] << 8) | (byteValues[j] & 0xFF);
                 }
@@ -973,21 +929,22 @@
             }
         }
     }
-    
-    int getFirstNonzeroDigit(){
-        if( firstNonzeroDigit == -2 ){
+
+    int getFirstNonzeroDigit() {
+        if (firstNonzeroDigit == -2) {
             int i;
-            if( this.sign == 0  ){
+            if (this.sign == 0) {
                 i = -1;
-            } else{
-                for(i=0; digits[i]==0; i++)
-                    ;
+            } else {
+                for (i = 0; digits[i] == 0; i++) {
+                    // Empty
+                }
             }
             firstNonzeroDigit = i;
         }
         return firstNonzeroDigit;
     }
-    
+
     /*
      * Returns a copy of the current instance to achieve immutability
      */
@@ -997,7 +954,6 @@
         return new BigInteger(sign, numberLength, copyDigits);
     }
 
-    /** @ar.org.fitc.spec_ref */
     private void readObject(ObjectInputStream in) throws IOException,
             ClassNotFoundException {
         in.defaultReadObject();
@@ -1006,15 +962,13 @@
         cutOffLeadingZeroes();
     }
 
-    /** @ar.org.fitc.spec_ref */
     private void writeObject(ObjectOutputStream out) throws IOException {
         signum = signum();
         magnitude = abs().toByteArray();
         out.defaultWriteObject();
     }
 
-    
-    void unCache(){
-    	firstNonzeroDigit = -2;
+    void unCache() {
+        firstNonzeroDigit = -2;
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/BHSDCodec.java Sun Sep 16 14:56:42 2007
@@ -55,6 +55,8 @@
 	 * Represents signed numbers or not (0=unsigned,1/2=signed)
 	 */
 	private int s;
+    
+    private long cardinality;
 
 	/**
 	 * Constructs an unsigned, non-delta Codec with the given B and H values.
@@ -118,6 +120,11 @@
 		this.s = s;
 		this.d = d;
 		this.l = 256 - h;
+        if(h == 1) {
+            cardinality = b * 255 + 1;
+        } else {
+            cardinality = (long) ((long)(l * (1-Math.pow(h, b))/(1-h)) + Math.pow(h,b));
+        }
 	}
 
 	/**
@@ -127,11 +134,7 @@
 	 * @return the cardinality of this codec
 	 */
 	public long cardinality() {
-		if (h > 1) {
-			return (long) (l * Math.pow(1 - h, b) / (1 - h) + Math.pow(h, b));
-		} else {
-			return (b * 255) + 1;
-		}
+		return cardinality;
 	}
 
 	
@@ -152,26 +155,43 @@
 			x = in.read();
 			if (x == -1)
 				throw new EOFException("End of stream reached whilst decoding");
-			z += x * Math.pow(h, n);
-		} while (++n < b && x >= l);
-		// This looks more complicated than it is
-		// When s=0, {1,2,3,4} is mapped to {1,2,3,4}
-		// When s=1, {1,2,3,4} is mapped to {-1,1,-2,2...}
-		// When s=2, {1,2,3,4} is mapped to {1,2,3,-1...}
-		if (isSigned()) {
-			int u = ((1 << s) - 1);
-			if ((z & u) == u) {
-				z = z >>> s ^ -1L;
-			} else {
-				z = z - (z >>> s);
-			}
-		}
+			z += x * Math.pow(h, n); 
+            n++;
+		} while (n < b & isHigh(x));
+        long u = z;
+        long twoPowS = (long)Math.pow(2, s);
+        double twoPowSMinusOne = twoPowS-1;
+        if(isSigned()) {
+            if(u % twoPowS < twoPowSMinusOne) {
+                if(cardinality < Math.pow(2, 32)) {
+                    z = (long) (u - (Math.floor(u/ twoPowS)));                    
+                } else {
+                    z = cast32((long) (u - (Math.floor(u/ twoPowS))));
+                }                
+            } else {
+                z = (long) (-Math.floor(u/ twoPowS) - 1);
+            }
+        } else {
+        // TODO: This is required in the spec, but it's making a test fail so needs more investigation.
+        //  z = cast32(u);
+        }
+        
+        
 		if (isDelta())
 			z += last;
 		return z;
 	}
 
-	/**
+	private long cast32(long u) {
+        u = (long) ((long) ((u + Math.pow(2, 31)) % Math.pow(2, 32)) - Math.pow(2, 31));
+        return u;
+    }
+
+    private boolean isHigh(long x) {
+        return x>=l;
+    }
+
+    /**
 	 * True if this encoding can code the given value
 	 * 
 	 * @param value

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/Codec.java Sun Sep 16 14:56:42 2007
@@ -249,7 +249,7 @@
     public long[] decode(int n, InputStream in, long firstValue) throws IOException,
             Pack200Exception {
         long result[] = new long[n + 1];
-        long last = 0;
+        long last = firstValue;
         for(int i=1;i<n+1;i++) {
             result[i] = last = decode(in,last);
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/CpBands.java Sun Sep 16 14:56:42 2007
@@ -203,12 +203,7 @@
     private void parseCpInt(InputStream in) throws IOException,
             Pack200Exception {
         int cpIntCount = header.getCpIntCount();
-        cpInt = new int[cpIntCount];
-        long last = 0;
-        for (int i = 0; i < cpIntCount; i++) {
-            last = Codec.UDELTA5.decode(in, last);
-            cpInt[i] = (int) last;
-        }
+        cpInt = decodeBandInt("cpInt", in, Codec.UDELTA5, cpIntCount);
     }
 
     private void parseCpLong(InputStream in) throws IOException,
@@ -316,18 +311,9 @@
         // TODO Update codec.decode -> decodeScalar
         cpUTF8 = new String[cpUTF8Count];
         cpUTF8[0] = ""; //$NON-NLS-1$
-        int[] prefix = new int[cpUTF8Count];
         int[] suffix = new int[cpUTF8Count];
-        if (cpUTF8Count > 0) {
-            prefix[0] = 0;
-            suffix[0] = 0;
-            if (cpUTF8Count > 1)
-                prefix[1] = 0;
-        }
         long last = 0;
-        for (int i = 2; i < cpUTF8Count; i++) {
-            last = prefix[i] = (int) Codec.DELTA5.decode(in, last);
-        }
+        int[] prefix = decodeBandInt("cpUTF8Prefix", in, Codec.DELTA5, cpUTF8Count-2);
         int chars = 0;
         int bigSuffix = 0;
         for (int i = 1; i < cpUTF8Count; i++) {
@@ -366,10 +352,10 @@
             if (suffix[i] == 0) {
                 // The big suffix stuff hasn't been tested, and I'll be
                 // surprised if it works first time w/o errors ...
-                cpUTF8[i] = lastString.substring(0, prefix[i])
+                cpUTF8[i] = lastString.substring(0, i>1 ? prefix[i-2] : 0)
                         + new String(bigSuffixData[bigSuffix++]);
             } else {
-                cpUTF8[i] = lastString.substring(0, prefix[i])
+                cpUTF8[i] = lastString.substring(0, i>1 ? prefix[i-2]: 0)
                         + new String(data, chars, suffix[i]);
                 chars += suffix[i];
             }

Modified: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java/org/apache/harmony/pack200/SegmentHeader.java Sun Sep 16 14:56:42 2007
@@ -131,7 +131,7 @@
      */
     private void setArchiveMajorVersion(int version) throws Pack200Exception {
         if (version != 150)
-            throw new Pack200Exception("Invalid segment major version");
+            throw new Pack200Exception("Invalid segment major version: " + version);
         archiveMajor = version;
     }
     
@@ -354,8 +354,9 @@
      */
     private long decodeScalar(String name, InputStream in, BHSDCodec codec)
             throws IOException, Pack200Exception {
-//        debug("Parsed #" + name + " (1)");
-        return codec.decode(in);
+        long ret =  codec.decode(in);
+        debug("Parsed #" + name + " as " + ret);
+        return ret;
     }
     
     public void setArchiveModtime(long archiveModtime) {
@@ -410,6 +411,12 @@
     public int getBandHeadersSize() {
         return bandHeadersSize;
     }
+    
+    protected void debug(String message) {
+      if (System.getProperty("debug.pack200") != null) {
+          System.err.println(message);
+      }
+  }
 
 
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF Sun Sep 16 14:56:42 2007
@@ -23,7 +23,8 @@
  java.util.logging,
  javax.net,
  javax.net.ssl,
- org.apache.harmony.kernel.vm
+ org.apache.harmony.kernel.vm,
+ org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional
 Export-Package: java.rmi,
  java.rmi.activation,
  java.rmi.dgc,

Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/build.xml Sun Sep 16 14:56:42 2007
@@ -204,6 +204,7 @@
                     </fileset>
                 </bootclasspath>
                 <classpath location="../../build/tests" />
+                <classpath location="${hy.hdk}/build/test/support.jar" />
             </javac>
         </sequential>
     </macrodef>
@@ -236,6 +237,7 @@
 
                 <classpath>
                     <pathelement path="${hy.rmi.src.test.resources}"/>
+                    <pathelement location="${hy.hdk}/build/test/support.jar"/>
                 </classpath>
 
                 <formatter type="xml" />

Modified: harmony/enhanced/classlib/branches/java6/modules/security/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/security/META-INF/MANIFEST.MF?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/security/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/security/META-INF/MANIFEST.MF Sun Sep 16 14:56:42 2007
@@ -33,7 +33,8 @@
  org.apache.harmony.luni.util,
  org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional,
  tests.support;hy_usage=test;resolution:=optional,
- tests.support.resource;hy_usage=test;resolution:=optional
+ tests.support.resource;hy_usage=test;resolution:=optional,
+ tests.util;hy_usage=test;resolution:=optional
 Export-Package: java.security,
  java.security.acl,
  java.security.cert,

Modified: harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Provider2Test.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Provider2Test.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/Provider2Test.java Sun Sep 16 14:56:42 2007
@@ -17,7 +17,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
 import java.security.Provider;
+import java.security.Security;
 
 public class Provider2Test extends junit.framework.TestCase {
 
@@ -123,5 +126,45 @@
     public void test_toString() {
         // Regression for HARMONY-3734
         assertEquals("provTest version 1.2", provTest.toString());
+    }
+    
+    // Regression Test for Provider.Service.getAlias(), which is an package
+    // private method but will lead to NPE thrown at
+    // Secure.SecurityDorr.getAliases
+    public void test_getAlias() throws Exception {
+        MockProvider mockProvider = new MockProvider("MOCKNAME", 1.0,
+                "MOCKINFO");
+        Provider.Service service = new Provider.Service(mockProvider,
+                "MOCKTYPE", "MOCKALGORITHM", "TESTCLASSNAME", null, null);
+        mockProvider.putService(service);
+        Security.addProvider(mockProvider);
+        try {
+            MessageDigest messageDigest = MessageDigest
+                    .getInstance("NOTEXISTS");
+        }
+
+        catch (NoSuchAlgorithmException e) {
+            // expected
+        } finally {
+            Security.removeProvider("MOCKNAME");
+        }
+    }
+
+    public static class MockProvider extends Provider {
+
+        private static final long serialVersionUID = 1L;
+
+        public MockProvider(String name, double version, String info) {
+            super(name, version, info);
+
+        }
+
+        public void putService(Provider.Service service) {
+            super.putService(service);
+        }
+
+        public void removeService(Provider.Service service) {
+            super.removeService(service);
+        }
     }
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/nls/messages.properties Sun Sep 16 14:56:42 2007
@@ -64,3 +64,6 @@
 rowset.1=Not a valid column name
 rowset.2=Negative page size
 rowset.3=Table name should not be null
+rowset.4=Not an insert row
+rowset.5=There are conflicts between rowset and data source
+

Modified: harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java?rev=576185&r1=576184&r2=576185&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java Sun Sep 16 14:56:42 2007
@@ -21,6 +21,8 @@
 public class CachedRow {
     private Object[] columnData;
 
+    private Object[] originalColumnData;
+
     private BitSet mask;
 
     private boolean isDelete;
@@ -29,6 +31,7 @@
 
     public CachedRow(Object[] columnData) {
         this.columnData = columnData;
+        this.originalColumnData = columnData;
         mask = new BitSet(columnData.length);
     }
 
@@ -64,5 +67,13 @@
     public void updateInt(int columnIndex, int x) {
         this.columnData[columnIndex - 1] = x;
         setUpdateMask(columnIndex - 1);
+    }
+
+    public String getString(int columnIndex) {
+        return (String) this.columnData[columnIndex - 1];
+    }
+
+    public int getInt(int columnIndex) {
+        return (Integer) this.columnData[columnIndex - 1];
     }
 }



Mime
View raw message