harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r889194 [1/2] - in /harmony/enhanced/classlib/branches/java6: ./ make/ modules/archive/src/main/java/java/util/jar/ modules/archive/src/main/java/java/util/zip/ modules/concurrent/src/main/java/java/util/concurrent/atomic/ modules/concurren...
Date Thu, 10 Dec 2009 11:24:05 GMT
Author: tonywu
Date: Thu Dec 10 11:23:50 2009
New Revision: 889194

URL: http://svn.apache.org/viewvc?rev=889194&view=rev
Log:
Revert r889068 because code freeze.

Added:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/ExposedByteArrayInputStream.java
      - copied unchanged from r889067, harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/ExposedByteArrayInputStream.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/InputStreamExposer.java
      - copied unchanged from r889067, harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/InputStreamExposer.java
Removed:
    harmony/enhanced/classlib/branches/java6/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java
    harmony/enhanced/classlib/branches/java6/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/InstrumentTestHelper.java
    harmony/enhanced/classlib/branches/java6/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/agents/
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/org/apache/harmony/luni/util/InputStreamHelper.java
Modified:
    harmony/enhanced/classlib/branches/java6/   (props changed)
    harmony/enhanced/classlib/branches/java6/make/build-test.xml
    harmony/enhanced/classlib/branches/java6/make/depends-common.xml   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/JarFile.java
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Manifest.java
    harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/atomic/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/locks/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c
    harmony/enhanced/classlib/branches/java6/modules/jmx/META-INF/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractMap.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractSet.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumSet.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HugeEnumSet.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/MiniEnumSet.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeMap.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeSet.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/fdlibm.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/gp.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hymagic.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hysocket.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hyvmls.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni_types.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmpi.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmri.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti_types.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmi.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmizip.h   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/SerializationStressTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java
    harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/net.resources/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/pack200/depends/manifests/asm-3.1/   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/rmi/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/java/rmi/server/RMIClassLoader.java
    harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/org/apache/harmony/security/utils/JarUtils.java
    harmony/enhanced/classlib/branches/java6/modules/security/src/test/api/java/org/apache/harmony/security/tests/java/security/SecureClassLoader2Test.java
    harmony/enhanced/classlib/branches/java6/modules/sound/src/main/java/org/apache/harmony/sound/utils/ProviderService.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLExceptionTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/java/sql/SQLWarningTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRequiredExceptionTest.java
    harmony/enhanced/classlib/branches/java6/modules/sql/src/test/java/org/apache/harmony/sql/tests/javax/transaction/TransactionRolledbackExceptionTest.java
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/BasicSwingTestCase.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/SwingTestCase.java   (props changed)
    harmony/enhanced/classlib/branches/java6/modules/swing/src/test/api/java.injected/javax/swing/text/parser/   (props changed)

Propchange: harmony/enhanced/classlib/branches/java6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1,2 +1,2 @@
-/harmony/enhanced/classlib/trunk:713674-735919,765923-889062
+/harmony/enhanced/classlib/trunk:713674-735919,765923-885602
 /harmony/enhanced/classlib/trunk/working_classlib:884014-884286

Modified: harmony/enhanced/classlib/branches/java6/make/build-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/make/build-test.xml?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/make/build-test.xml (original)
+++ harmony/enhanced/classlib/branches/java6/make/build-test.xml Thu Dec 10 11:23:50 2009
@@ -27,20 +27,6 @@
     <property name="tests.output" location="build/test_report" />
     <import file="${basedir}/make/properties.xml" />
 
-    <property name="gen.report" value="true" />
-    <condition property="do.full.report" value="true">
-        <and>
-            <equals arg1="${gen.report}" arg2="true" />
-            <not><equals arg1="${short.report}" arg2="true" /></not>
-        </and>
-    </condition>
-    <condition property="do.short.report" value="true">
-        <and>
-            <equals arg1="${gen.report}" arg2="true" />
-            <equals arg1="${short.report}" arg2="true" />
-        </and>
-    </condition>
-
     <property name="tests.support.output" location="build/test_support" />
     <property name="support.dir" location="support"/>
     <property name="tests.depends.jars" location="deploy/jdk/jre/lib/boot" />
@@ -85,7 +71,7 @@
 
     <property name="report.dir" value="${tests.output}/html"/>
 
-    <target name="full-report" if="do.full.report" >
+    <target name="full-report" unless="short.report" >
         <delete dir="${report.dir}" />
         <junitreport todir="${tests.output}">
             <fileset dir="${tests.output}">
@@ -99,7 +85,7 @@
         <echo message="The test report is in ${display-location}"/>
     </target>
 
-    <target name="short-report" if="do.short.report">
+    <target name="short-report" if="short.report" >
         <delete dir="${report.dir}" />
         <junitreport todir="${tests.output}">
             <fileset dir="${tests.output}" includes="TEST*-*.xml">

Propchange: harmony/enhanced/classlib/branches/java6/make/depends-common.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/make/depends-common.xml:768152-889062
+/harmony/enhanced/classlib/trunk/make/depends-common.xml:768152-885602

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/JarFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/JarFile.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/JarFile.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/JarFile.java Thu Dec 10 11:23:50 2009
@@ -17,19 +17,19 @@
 
 package java.util.jar;
 
+import java.io.ByteArrayOutputStream;
+import java.util.List;
+import java.util.ArrayList;
 import java.io.File;
 import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
 import org.apache.harmony.archive.internal.nls.Messages;
 import org.apache.harmony.archive.util.Util;
-import org.apache.harmony.luni.util.InputStreamHelper;
 
 /**
  * {@code JarFile} is used to read jar entries and their associated data from
@@ -282,6 +282,42 @@
         return (JarEntry) getEntry(name);
     }
 
+    /*
+     * Drains the entire content from the given input stream and returns it as a
+     * byte[]. The stream is closed after being drained, or if an IOException
+     * occurs.
+     */
+    private byte[] getAllBytesFromStreamAndClose(InputStream is)
+            throws IOException {
+        try {
+            // Initial read
+            byte[] buffer = new byte[1024];
+            int count = is.read(buffer);
+            int nextByte = is.read();
+
+            // Did we get it all in one read?
+            if (nextByte == -1) {
+                byte[] dest = new byte[count];
+                System.arraycopy(buffer, 0, dest, 0, count);
+                return dest;
+            }
+
+            // Requires additional reads
+            ByteArrayOutputStream baos = new ByteArrayOutputStream(count * 2);
+            baos.write(buffer, 0, count);
+            baos.write(nextByte);
+            while (true) {
+                count = is.read(buffer);
+                if (count == -1) {
+                    return baos.toByteArray();
+                }
+                baos.write(buffer, 0, count);
+            }
+        } finally {
+            is.close();
+        }
+    }
+
     /**
      * Returns the {@code Manifest} object associated with this {@code JarFile}
      * or {@code null} if no MANIFEST entry exists.
@@ -304,8 +340,7 @@
         try {
             InputStream is = super.getInputStream(manifestEntry);
             if (verifier != null) {
-                verifier.addMetaEntry(manifestEntry.getName(),
-                        InputStreamHelper.readFullyAndClose(is));
+                verifier.addMetaEntry(manifestEntry.getName(), getAllBytesFromStreamAndClose(is));
                 is = super.getInputStream(manifestEntry);
             }
             try {
@@ -357,7 +392,7 @@
                                 || Util.asciiEndsWithIgnoreCase(entryName, ".RSA"))) {
                     signed = true;
                     InputStream is = super.getInputStream(entry);
-                    byte[] buf = InputStreamHelper.readFullyAndClose(is);
+                    byte[] buf = getAllBytesFromStreamAndClose(is);
                     verifier.addMetaEntry(entryName, buf);
                 }
             }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Manifest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Manifest.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Manifest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/jar/Manifest.java Thu Dec 10 11:23:50 2009
@@ -30,7 +30,7 @@
 import java.util.Map;
 
 import org.apache.harmony.archive.internal.nls.Messages;
-import org.apache.harmony.luni.util.InputStreamHelper;
+import org.apache.harmony.luni.util.InputStreamExposer;
 import org.apache.harmony.luni.util.ThreadLocalCache;
 
 /**
@@ -209,7 +209,7 @@
         byte[] buf;
         // Try to read get a reference to the bytes directly
         try {
-            buf = InputStreamHelper.expose(is);
+            buf = InputStreamExposer.expose(is);
         } catch (UnsupportedOperationException uoe) {
             buf = readFully(is);
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/archive/src/main/java/java/util/zip/ZipFile.java Thu Dec 10 11:23:50 2009
@@ -368,6 +368,7 @@
         RandomAccessFile mSharedRaf;
         long mOffset;
         long mLength;
+        private byte[] singleByteBuf = new byte[1];
 
         public RAFStream(RandomAccessFile raf, long pos) throws IOException {
             mSharedRaf = raf;
@@ -382,7 +383,6 @@
 
         @Override
         public int read() throws IOException {
-            byte[] singleByteBuf = new byte[1];
             if (read(singleByteBuf, 0, 1) == 1) {
                 return singleByteBuf[0] & 0XFF;
             } else {

Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/atomic/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-889062
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/atomic:765923-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/locks/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-889062
+/harmony/enhanced/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks:765923-885602

Modified: harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/instrument/src/main/native/instrument/shared/inst_agt.c Thu Dec 10 11:23:50 2009
@@ -206,7 +206,7 @@
 
     /* read bytes */
     size = zipEntry.uncompressedSize;
-    result = (char *)hymem_allocate_memory(size*sizeof(char) + 1);
+    result = (char *)hymem_allocate_memory(size*sizeof(char));
 #ifndef HY_ZIP_API
     retval = zip_getZipEntryData(privatePortLibrary, &zipFile, &zipEntry, (unsigned char*)result, size);
 #else /* HY_ZIP_API */
@@ -223,7 +223,6 @@
         return NULL;
     }
 
-    result[size] = '\0';
     /* free resource */
 #ifndef HY_ZIP_API
     zip_freeZipEntry(privatePortLibrary, &zipEntry);
@@ -244,7 +243,6 @@
     char *pos;
     char *end;
     char *value;
-    char *tmp;
     int length;
     PORT_ACCESS_FROM_JAVAVM(vm);
 
@@ -255,46 +253,18 @@
     pos = manifest+ (strstr(lwrmanifest,target) - lwrmanifest);
     pos += strlen(target)+2;//": "
     end = strchr(pos, '\n');
-
-    while (end != NULL && *(end + 1) == ' ') {
-        end = strchr(end + 1, '\n');
-    }
-
     if(NULL == end){
         end = manifest + strlen(manifest);
     }
-
+    /* in windows, has '\r\n' in the end of line, omit '\r' */
+    if (*(end - 1) == '\r'){
+        end--;
+    }
     length = end - pos;
 
     value = (char *)hymem_allocate_memory(sizeof(char)*(length+1));
-    tmp = value;
-
-    end = strchr(pos, '\n');
-    while (end != NULL && *(end + 1) == ' ') {
-        /* in windows, has '\r\n' in the end of line, omit '\r' */
-        if (*(end - 1) == '\r') {
-            strncpy(tmp, pos, end - 1 - pos);
-            tmp += end - 1 - pos;
-            pos = end + 2;
-        } else {
-            strncpy(tmp, pos, end - pos);
-            tmp += end - pos;
-            pos = end + 2;
-        }
-        end = strchr(end + 1, '\n');
-    }
-
-    if (NULL == end) {
-        strcpy(tmp, pos);
-    } else {
-        /* in windows, has '\r\n' in the end of line, omit '\r' */
-        if (*(end - 1) == '\r') {
-            end--;
-        }
-        strncpy(tmp, pos, end - pos);
-        *(tmp + (end - pos)) = '\0';
-    }
-
+    strncpy(value, pos, length);
+    *(value+length) = '\0';
     return value;
 }
 
@@ -346,11 +316,7 @@
     check_jvmti_error(env, (*jvmti)->GetSystemProperty(jvmti,"java.class.path",&classpath),"Failed to get classpath.");
     classpath_cpy = (char *)hymem_allocate_memory((sizeof(char)*(strlen(classpath)+strlen(jar_name)+2)));
     strcpy(classpath_cpy,classpath);
-#if defined(WIN32) || defined(WIN64)
     strcat(classpath_cpy,";");
-#else
-    strcat(classpath_cpy,":");
-#endif
     strcat(classpath_cpy,jar_name);
     check_jvmti_error(env, (*jvmti)->SetSystemProperty(jvmti, "java.class.path",classpath_cpy),"Failed to set classpath.");
     hymem_free_memory(classpath_cpy);
@@ -373,9 +339,9 @@
     str_support_redefine = read_attribute(vm, manifest, lwrmanifest,"can-redefine-classes");
     if(NULL != str_support_redefine){
         support_redefine = str2bol(str_support_redefine);
+        gsupport_redefine |= support_redefine;
         hymem_free_memory(str_support_redefine);
     }
-    gsupport_redefine &= support_redefine;
 
     //add bootclasspath
 
@@ -396,10 +362,6 @@
 JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved){
     PORT_ACCESS_FROM_JAVAVM(vm);
     VMI_ACCESS_FROM_JAVAVM(vm);
-    jvmtiError jvmti_err;
-    JNIEnv *env = NULL;
-    static jvmtiEnv *jvmti;
-    jvmtiCapabilities updatecapabilities;
     jint err = (*vm)->GetEnv(vm, (void **)&jnienv, JNI_VERSION_1_2);
     if(JNI_OK != err){
         return err;
@@ -409,6 +371,8 @@
         jvmtiCapabilities capabilities;
         jvmtiError jvmti_err;
         jvmtiEventCallbacks callbacks;
+        JNIEnv *env = NULL;
+        static jvmtiEnv *jvmti;
 
         gdata = hymem_allocate_memory(sizeof(AgentData));
 
@@ -419,10 +383,15 @@
         }
         gdata->jvmti = jvmti;
 
-        //get JVMTI potential capabilities
-        jvmti_err = (*jvmti)->GetPotentialCapabilities(jvmti, &capabilities);
-        check_jvmti_error(env, jvmti_err, "Cannot get JVMTI potential capabilities.");
-        gsupport_redefine = (capabilities.can_redefine_classes == 1);
+        //set prerequisite capabilities for classfileloadhook, redefine, and VMInit event
+        memset(&capabilities, 0, sizeof(capabilities));
+        capabilities.can_generate_all_class_hook_events=1;
+        capabilities.can_redefine_classes = 1;
+        //FIXME VM doesnot support the capbility right now.
+        //capabilities.can_redefine_any_class = 1;
+        jvmti_err = (*jvmti)->AddCapabilities(jvmti, &capabilities);
+        check_jvmti_error(env, jvmti_err,
+                          "Cannot add JVMTI capabilities.");
 
         //set events callback function
         (void)memset(&callbacks, 0, sizeof(callbacks));
@@ -436,18 +405,7 @@
         check_jvmti_error(env, jvmti_err, "Cannot set JVMTI VMInit event notification mode.");
     }
 
-    err = Parse_Options(vm,jnienv, gdata->jvmti,options);
-
-    //update capabilities JVMTI
-    memset(&updatecapabilities, 0, sizeof(updatecapabilities));
-    updatecapabilities.can_generate_all_class_hook_events = 1;
-    updatecapabilities.can_redefine_classes = gsupport_redefine;
-    //FIXME VM doesnot support the capbility right now.
-    //capabilities.can_redefine_any_class = 1;
-    jvmti_err = (*jvmti)->AddCapabilities(jvmti, &updatecapabilities);
-    check_jvmti_error(env, jvmti_err, "Cannot add JVMTI capabilities.");
-
-    return err;
+    return Parse_Options(vm,jnienv, gdata->jvmti,options);
 }
 
 JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *vm){

Propchange: harmony/enhanced/classlib/branches/java6/modules/jmx/META-INF/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-889062
+/harmony/enhanced/classlib/trunk/modules/jmx/META-INF:768152-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-889062
+/harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/lang/management/tests/java/util/logging:768152-885602

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/META-INF/MANIFEST.MF Thu Dec 10 11:23:50 2009
@@ -21,7 +21,6 @@
  java.security,
  java.security.cert,
  java.text,
- java.util.concurrent;resolution:=optional,
  java.util.jar,
  java.util.regex,
  java.util.zip,

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractMap.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractMap.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractMap.java Thu Dec 10 11:23:50 2009
@@ -370,22 +370,19 @@
                 return false;
             }
 
+            Iterator<Map.Entry<K, V>> it = entrySet().iterator();
+
             try {
-                for (Entry<K, V> entry : entrySet()) {
+                while (it.hasNext()) {
+                    Entry<K, V> entry = it.next();
                     K key = entry.getKey();
-                    V mine = entry.getValue();
-                    Object theirs = map.get(key);
-                    if (mine == null) {
-                        if (theirs != null || !map.containsKey(key)) {
-                            return false;
-                        }
-                    } else if (!mine.equals(theirs)) {
+                    V value = entry.getValue();
+                    Object obj = map.get(key);
+                    if( null != obj && (!obj.equals(value)) || null == obj && obj != value) {
                         return false;
                     }
                 }
-            } catch (NullPointerException ignored) {
-                return false;
-            } catch (ClassCastException ignored) {
+            } catch (ClassCastException cce) {
                 return false;
             }
             return true;

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractSet.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/AbstractSet.java Thu Dec 10 11:23:50 2009
@@ -55,9 +55,7 @@
 
             try {
                 return size() == s.size() && containsAll(s);
-            } catch (NullPointerException ignored) {
-                return false;
-            } catch (ClassCastException ignored) {
+            } catch (ClassCastException cce) {
                 return false;
             }
         }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/Collections.java Thu Dec 10 11:23:50 2009
@@ -20,7 +20,6 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.ObjectStreamException;
 import java.io.Serializable;
 import java.lang.reflect.Array;
 
@@ -190,15 +189,8 @@
     @SuppressWarnings("unchecked")
     public static final Map EMPTY_MAP = new EmptyMap();
 
-    /**
-     * This class is a singleton so that equals() and hashCode() work properly.
-     */
     private static final class ReverseComparator<T> implements Comparator<T>,
             Serializable {
-
-        private static final ReverseComparator<Object> INSTANCE
-                = new ReverseComparator<Object>();
-
         private static final long serialVersionUID = 7207038068494060240L;
 
         @SuppressWarnings("unchecked")
@@ -206,10 +198,6 @@
             Comparable<T> c2 = (Comparable<T>) o2;
             return c2.compareTo(o1);
         }
-
-        private Object readResolve() throws ObjectStreamException {
-            return INSTANCE;
-        }
     }
 
     private static final class ReverseComparatorWithComparator<T> implements
@@ -226,18 +214,6 @@
         public int compare(T o1, T o2) {
             return comparator.compare(o2, o1);
         }
-
-        @Override
-        public boolean equals(Object o) {
-            return o instanceof ReverseComparatorWithComparator
-                    && ((ReverseComparatorWithComparator) o).comparator
-                            .equals(comparator);
-        }
-
-        @Override
-        public int hashCode() {
-            return ~comparator.hashCode();
-        }
     }
 
     private static final class SingletonSet<E> extends AbstractSet<E> implements
@@ -377,17 +353,34 @@
                         }
 
                         public Map.Entry<K, V> next() {
-                            if (!hasNext) {
-                                throw new NoSuchElementException();
+                            if (hasNext) {
+                                hasNext = false;
+                                return new Map.Entry<K, V>() {
+                                    @Override
+                                    public boolean equals(Object object) {
+                                        return contains(object);
+                                    }
+
+                                    public K getKey() {
+                                        return k;
+                                    }
+
+                                    public V getValue() {
+                                        return v;
+                                    }
+
+                                    @Override
+                                    public int hashCode() {
+                                        return (k == null ? 0 : k.hashCode())
+                                                ^ (v == null ? 0 : v.hashCode());
+                                    }
+
+                                    public V setValue(V value) {
+                                        throw new UnsupportedOperationException();
+                                    }
+                                };
                             }
-
-                            hasNext = false;
-                            return new MapEntry<K, V>(k, v) {
-                                @Override
-                                public V setValue(V value) {
-                                    throw new UnsupportedOperationException();
-                                }
-                            };
+                            throw new NoSuchElementException();
                         }
 
                         public void remove() {
@@ -1692,12 +1685,6 @@
      */
     public static <T> T max(Collection<? extends T> collection,
             Comparator<? super T> comparator) {
-        if (comparator == null) {
-            @SuppressWarnings("unchecked") // null comparator? T is comparable
-            T result = (T) max((Collection<Comparable>) collection);
-            return result;
-        }
-
         Iterator<? extends T> it = collection.iterator();
         T max = it.next();
         while (it.hasNext()) {
@@ -1748,12 +1735,6 @@
      */
     public static <T> T min(Collection<? extends T> collection,
             Comparator<? super T> comparator) {
-        if (comparator == null) {
-            @SuppressWarnings("unchecked") // null comparator? T is comparable
-            T result = (T) min((Collection<Comparable>) collection);
-            return result;
-        }
-
         Iterator<? extends T> it = collection.iterator();
         T min = it.next();
         while (it.hasNext()) {
@@ -1813,9 +1794,8 @@
      * @see Comparable
      * @see Serializable
      */
-    @SuppressWarnings("unchecked")
     public static <T> Comparator<T> reverseOrder() {
-        return (Comparator) ReverseComparator.INSTANCE;
+        return new ReverseComparator<T>();
     }
 
     /**
@@ -1836,9 +1816,6 @@
         if (c == null) {
             return reverseOrder();
         }
-        if (c instanceof ReverseComparatorWithComparator) {
-            return ((ReverseComparatorWithComparator<T>) c).comparator;
-        }
         return new ReverseComparatorWithComparator<T>(c);
     }
 
@@ -2684,8 +2661,8 @@
      *            class of object that should be
      * @return specified object
      */
-    static <E> E checkType(E obj, Class<? extends E> type) {
-        if (obj != null && !type.isInstance(obj)) {
+    static <E> E checkType(E obj, Class<E> type) {
+        if (!type.isInstance(obj)) {
             // luni.05=Attempt to insert {0} element into collection with
             // element type {1}
             throw new ClassCastException(Messages.getString(
@@ -3022,11 +2999,20 @@
          */
         @SuppressWarnings("unchecked")
         public boolean addAll(Collection<? extends E> c1) {
-            Object[] array = c1.toArray();
-            for (Object o : array) {
-                checkType(o, type);
+            int size = c1.size();
+            if (size == 0) {
+                return false;
             }
-            return c.addAll((List<E>) Arrays.asList(array));
+            E[] arr = (E[]) new Object[size];
+            Iterator<? extends E> it = c1.iterator();
+            for (int i = 0; i < size; i++) {
+                arr[i] = checkType(it.next(), type);
+            }
+            boolean added = false;
+            for (int i = 0; i < size; i++) {
+                added |= c.add(arr[i]);
+            }
+            return added;
         }
 
         /**
@@ -3172,11 +3158,16 @@
          */
         @SuppressWarnings("unchecked")
         public boolean addAll(int index, Collection<? extends E> c1) {
-            Object[] array = c1.toArray();
-            for (Object o : array) {
-                checkType(o, type);
+            int size = c1.size();
+            if (size == 0) {
+                return false;
+            }
+            E[] arr = (E[]) new Object[size];
+            Iterator<? extends E> it = c1.iterator();
+            for (int i = 0; i < size; i++) {
+                arr[i] = checkType(it.next(), type);
             }
-            return l.addAll(index, (List<E>) Arrays.asList(array));
+            return l.addAll(index, Arrays.asList(arr));
         }
 
         /**

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumSet.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/EnumSet.java Thu Dec 10 11:23:50 2009
@@ -103,7 +103,7 @@
         if (c instanceof EnumSet) {
             return copyOf((EnumSet<E>) c);
         }
-        if (c.isEmpty()) {
+        if (0 == c.size()) {
             throw new IllegalArgumentException();
         }
         Iterator<E> iterator = c.iterator();
@@ -304,13 +304,15 @@
     @Override
     public EnumSet<E> clone() {
         try {
-            return (EnumSet<E>) super.clone();
+            Object set = super.clone();
+            return (EnumSet<E>) set;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e);
+            return null;
         }
     }
 
-    boolean isValidType(Class<?> cls) {
+    @SuppressWarnings("unchecked")
+    boolean isValidType(Class cls) {
         return cls == elementClass || cls.getSuperclass() == elementClass;
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HugeEnumSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HugeEnumSet.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HugeEnumSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/HugeEnumSet.java Thu Dec 10 11:23:50 2009
@@ -18,95 +18,90 @@
 
 
 /**
- * A concrete EnumSet for enums with more than 64 elements.
+ * This is a concrete subclass of EnumSet designed specifically for enum type
+ * with more than 64 elements.
+ * 
  */
 @SuppressWarnings("serial")
 final class HugeEnumSet<E extends Enum<E>> extends EnumSet<E> {
     
-    private static final int BIT_IN_LONG = 64;
-
     final private E[] enums;
     
     private long[] bits;
     
     private int size;
     
+    private static final int BIT_IN_LONG = 64;
+    
     HugeEnumSet(Class<E> elementType) {
         super(elementType);
         enums = elementType.getEnumConstants();
         bits = new long[(enums.length + BIT_IN_LONG - 1) / BIT_IN_LONG];
+        Arrays.fill(bits, 0);
     }
     
     private class HugeEnumSetIterator implements Iterator<E> {
 
-        /**
-         * The bits yet to be returned for the long in bits[index]. As values from the current index
-         * are returned, their bits are zeroed out. When this reaches zero, the index must be
-         * incremented.
-         */
-        private long currentBits = bits[0];
+        private long[] unProcessedBits;
 
-        /**
-         * The index into HugeEnumSet.bits of the next value to return.
-         */
-        private int index;
+        private int bitsPosition = 0;
 
-        /**
-         * The single bit of the next value to return.
+        /*
+         * Mask for current element.
          */
-        private long mask;
+        private long currentElementMask = 0;
 
-        /**
-         * The candidate for removal. If null, no value may be removed.
-         */
-        private E last;
+        boolean canProcess = true;
 
         private HugeEnumSetIterator() {
-            computeNextElement();
+            unProcessedBits = new long[bits.length];
+            System.arraycopy(bits, 0, unProcessedBits, 0, bits.length);
+            bitsPosition = unProcessedBits.length;
+            findNextNoneZeroPosition(0);
+            if (bitsPosition == unProcessedBits.length) {
+                canProcess = false;
+            }
         }
 
-        /**
-         * Assigns mask and index to the next available value, cycling currentBits as necessary.
-         */
-        void computeNextElement() {
-            while (true) {
-                if (currentBits != 0) {
-                    mask = currentBits & -currentBits; // the lowest 1 bit in currentBits
-                    return;
-                } else if (++index < bits.length) {
-                    currentBits = bits[index];
-                } else {
-                    mask = 0;
-                    return;
+        private void findNextNoneZeroPosition(int start) {
+            for (int i = start; i < unProcessedBits.length; i++) {
+                if (0 != bits[i]) {
+                    bitsPosition = i;
+                    break;
                 }
             }
         }
 
         public boolean hasNext() {
-            return mask != 0;
+            return canProcess;
         }
 
         public E next() {
-            if (mask == 0) {
+            if (!canProcess) {
                 throw new NoSuchElementException();
             }
-
-            int ordinal = Long.numberOfTrailingZeros(mask) + index * BIT_IN_LONG;
-            last = enums[ordinal];
-
-            currentBits &= ~mask;
-            computeNextElement();
-
-            return last;
+            currentElementMask = unProcessedBits[bitsPosition]
+                    & (-unProcessedBits[bitsPosition]);
+            unProcessedBits[bitsPosition] -= currentElementMask;
+            int index = Long.numberOfTrailingZeros(currentElementMask)
+                    + bitsPosition * BIT_IN_LONG;
+            if (0 == unProcessedBits[bitsPosition]) {
+                int oldBitsPosition = bitsPosition;
+                findNextNoneZeroPosition(bitsPosition + 1);
+                if (bitsPosition == oldBitsPosition) {
+                    canProcess = false;
+                }
+            }
+            return enums[index];
         }
 
         public void remove() {
-            if (last == null) {
+            if (currentElementMask == 0) {
                 throw new IllegalStateException();
             }
-
-            HugeEnumSet.this.remove(last);
-            last = null;
+            bits[bitsPosition] &= ~currentElementMask;
+            size--;
+            currentElementMask = 0;
         }
     }
     
@@ -115,44 +110,38 @@
         if (!isValidType(element.getDeclaringClass())) {
             throw new ClassCastException();
         }
+        calculateElementIndex(element);
 
-        int ordinal = element.ordinal();
-        int index = ordinal / BIT_IN_LONG;
-        int inBits = ordinal % BIT_IN_LONG;
-        long oldBits = bits[index];
-        long newBits = oldBits | (1L << inBits);
-        if (oldBits != newBits) {
-            bits[index] = newBits;
-            size++;
-            return true;
+        bits[bitsIndex] |= (1l << elementInBits);
+        if (oldBits == bits[bitsIndex]) {
+            return false;
         }
-        return false;
+        size++;
+        return true;
     }
     
     @Override
     public boolean addAll(Collection<? extends E> collection) {
-        if (collection.isEmpty() || collection == this) {
+        if (0 == collection.size() || this == collection) {
             return false;
         }
-
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
+            EnumSet set = (EnumSet) collection;
             if (!isValidType(set.elementClass)) {
                 throw new ClassCastException();
             }
-
-            HugeEnumSet<E> hugeSet = (HugeEnumSet<E>) set;
-            boolean changed = false;
+            HugeEnumSet hugeSet = (HugeEnumSet) set;
+            boolean addSuccessful = false;
             for (int i = 0; i < bits.length; i++) {
-                long oldBits = bits[i];
-                long newBits = oldBits | hugeSet.bits[i];
-                if (oldBits != newBits) {
-                    bits[i] = newBits;
-                    size += Long.bitCount(newBits) - Long.bitCount(oldBits);
-                    changed = true;
+                oldBits = bits[i];
+                bits[i] |= hugeSet.bits[i];
+                if (oldBits != bits[i]) {
+                    addSuccessful = true;
+                    size = size - Long.bitCount(oldBits)
+                            + Long.bitCount(bits[i]);
                 }
             }
-            return changed;
+            return addSuccessful;
         }
         return super.addAll(collection);
     }
@@ -170,53 +159,61 @@
     
     @Override
     protected void complement() {
-        size = 0;
-        for (int i = 0, length = bits.length; i < length; i++) {
-            long b = ~bits[i];
+        if (0 != enums.length) {
+            bitsIndex = enums.length / BIT_IN_LONG;
 
-            // zero out unused bits on the last element
-            if (i == length - 1) {
-                b &= -1L >>> (BIT_IN_LONG - (enums.length % BIT_IN_LONG));
+            size = 0;
+            int bitCount = 0;
+            for (int i = 0; i <= bitsIndex; i++) {
+                bits[i] = ~bits[i];
+                bitCount = Long.bitCount(bits[i]);
+                size += bitCount;
             }
-
-            size += Long.bitCount(b);
-            bits[i] = b;
+            bits[bitsIndex] &= (-1l >>> (BIT_IN_LONG - enums.length
+                    % BIT_IN_LONG));
+            size -= bitCount;
+            bitCount = Long.bitCount(bits[bitsIndex]);
+            size += bitCount;
         }
     }
     
+    @SuppressWarnings("unchecked")
     @Override
     public boolean contains(Object object) {
-        if (object == null || !isValidType(object.getClass())) {
+        if (null == object) {
             return false;
         }
-
-        @SuppressWarnings("unchecked") // guarded by isValidType()
-        int ordinal = ((E) object).ordinal();
-        int index = ordinal / BIT_IN_LONG;
-        int inBits = ordinal % BIT_IN_LONG;
-        return (bits[index] & (1L << inBits)) != 0;
+        if (!isValidType(object.getClass())) {
+            return false;
+        }
+        calculateElementIndex((E)object);
+        return (bits[bitsIndex] & (1l << elementInBits)) != 0;
     }
     
     @Override
+    @SuppressWarnings("unchecked")
     public HugeEnumSet<E> clone() {
-        HugeEnumSet<E> set = (HugeEnumSet<E>) super.clone();
-        set.bits = bits.clone();
-        return set;
+        Object set = super.clone();
+        if (null != set) {
+            ((HugeEnumSet<E>) set).bits = bits.clone();
+            return (HugeEnumSet<E>) set;
+        }
+        return null;
     }
     
     @Override
     public boolean containsAll(Collection<?> collection) {
-        if (collection.isEmpty()) {
+        if (collection.size() == 0) {
             return true;
         }
         if (collection instanceof HugeEnumSet) {
-            HugeEnumSet<?> set = (HugeEnumSet<?>) collection;
-            if (isValidType(set.elementClass)) {
-                for (int i = 0; i < bits.length; i++) {
-                    long setBits = set.bits[i];
-                    if ((bits[i] & setBits) != setBits) {
+            HugeEnumSet set = (HugeEnumSet) collection;
+            if(isValidType(set.elementClass )) {
+                for(int i = 0; i < bits.length; i++) {
+                    if((bits[i] & set.bits[i]) != set.bits[i]){
                         return false;
                     }
+                    
                 }
                 return true;
             }
@@ -226,13 +223,13 @@
     
     @Override
     public boolean equals(Object object) {
-        if (object == null) {
+        if (null == object) {
             return false;
         }
         if (!isValidType(object.getClass())) {
             return super.equals(object);
         }
-        return Arrays.equals(bits, ((HugeEnumSet<?>) object).bits);
+        return Arrays.equals(bits, ((HugeEnumSet) object).bits);
     }
     
     @Override
@@ -242,48 +239,38 @@
     
     @Override
     public boolean remove(Object object) {
-        if (object == null || !isValidType(object.getClass())) {
+        if (!contains(object)) {
             return false;
         }
-
-        @SuppressWarnings("unchecked") // guarded by isValidType()
-        int ordinal = ((E) object).ordinal();
-        int index = ordinal / BIT_IN_LONG;
-        int inBits = ordinal % BIT_IN_LONG;
-        long oldBits = bits[index];
-        long newBits = oldBits & ~(1L << inBits);
-        if (oldBits != newBits) {
-            bits[index] = newBits;
-            size--;
-            return true;
-        }
-        return false;
+        bits[bitsIndex] -= (1l << elementInBits);
+        size--;
+        return true;
     }
     
     @Override
     public boolean removeAll(Collection<?> collection) {
-        if (collection.isEmpty()) {
+        if (0 == collection.size()) {
             return false;
         }
         
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
+            EnumSet<E> set = (EnumSet<E>) collection;
             if (!isValidType(set.elementClass)) {
                 return false;
             }
-
-            HugeEnumSet<E> hugeSet = (HugeEnumSet<E>) set;
-            boolean changed = false;
+            boolean removeSuccessful = false;
+            long mask = 0;
             for (int i = 0; i < bits.length; i++) {
-                long oldBits = bits[i];
-                long newBits = oldBits & ~hugeSet.bits[i];
-                if (oldBits != newBits) {
-                    bits[i] = newBits;
-                    size += Long.bitCount(newBits) - Long.bitCount(oldBits);
-                    changed = true;
+                oldBits = bits[i];
+                mask = bits[i] & ((HugeEnumSet<E>) set).bits[i];
+                if (mask != 0) {
+                    bits[i] -= mask;
+                    size = (size - Long.bitCount(oldBits) + Long
+                            .bitCount(bits[i]));
+                    removeSuccessful = true;
                 }
             }
-            return changed;
+            return removeSuccessful;
         }
         return super.removeAll(collection);
     }
@@ -291,65 +278,72 @@
     @Override
     public boolean retainAll(Collection<?> collection) {
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
+            EnumSet<E> set = (EnumSet<E>) collection;
             if (!isValidType(set.elementClass)) {
-                if (size > 0) {
-                    clear();
-                    return true;
-                } else {
-                    return false;
-                }
+                clear();
+                return true;
             }
 
-            HugeEnumSet<E> hugeSet = (HugeEnumSet<E>) set;
-            boolean changed = false;
+            boolean retainSuccessful = false;
+            oldBits = 0;
             for (int i = 0; i < bits.length; i++) {
-                long oldBits = bits[i];
-                long newBits = oldBits & hugeSet.bits[i];
-                if (oldBits != newBits) {
-                    bits[i] = newBits;
-                    size += Long.bitCount(newBits) - Long.bitCount(oldBits);
-                    changed = true;
+                oldBits = bits[i];
+                bits[i] &= ((HugeEnumSet<E>) set).bits[i];
+                if (oldBits != bits[i]) {
+                    size = size - Long.bitCount(oldBits)
+                            + Long.bitCount(bits[i]);
+                    retainSuccessful = true;
                 }
             }
-            return changed;
+            return retainSuccessful;
         }
         return super.retainAll(collection);
     }
     
     @Override
     void setRange(E start, E end) {
-        int startOrdinal = start.ordinal();
-        int startIndex = startOrdinal / BIT_IN_LONG;
-        int startInBits = startOrdinal % BIT_IN_LONG;
-
-        int endOrdinal = end.ordinal();
-        int endIndex = endOrdinal / BIT_IN_LONG;
-        int endInBits = endOrdinal % BIT_IN_LONG;
-
-        if (startIndex == endIndex) {
-            long range = (-1L >>> (BIT_IN_LONG -(endInBits - startInBits + 1))) << startInBits;
-            size -= Long.bitCount(bits[startIndex]);
-            bits[startIndex] |= range;
-            size += Long.bitCount(bits[startIndex]);
-
+        calculateElementIndex(start);
+        int startBitsIndex = bitsIndex;
+        int startElementInBits = elementInBits;
+        calculateElementIndex(end);
+        int endBitsIndex = bitsIndex;
+        int endElementInBits = elementInBits;
+        long range = 0;
+        if (startBitsIndex == endBitsIndex) {
+            range = (-1l >>> (BIT_IN_LONG -(endElementInBits - startElementInBits + 1))) << startElementInBits;
+            size -= Long.bitCount(bits[bitsIndex]);
+            bits[bitsIndex] |= range;
+            size += Long.bitCount(bits[bitsIndex]);
         } else {
-            long range = (-1L >>> startInBits) << startInBits;
-            size -= Long.bitCount(bits[startIndex]);
-            bits[startIndex] |= range;
-            size += Long.bitCount(bits[startIndex]);
-
-            // endInBits + 1 is the number of consecutive ones.
-            // 63 - endInBits is the following zeros of the right most one.
-            range = -1L >>> (BIT_IN_LONG - (endInBits + 1));
-            size -= Long.bitCount(bits[endIndex]);
-            bits[endIndex] |= range;
-            size += Long.bitCount(bits[endIndex]);
-            for (int i = (startIndex + 1); i <= (endIndex - 1); i++) {
+            range = (-1l >>> startElementInBits) << startElementInBits;
+            size -= Long.bitCount(bits[startBitsIndex]);
+            bits[startBitsIndex] |= range;
+            size += Long.bitCount(bits[startBitsIndex]);
+
+            // endElementInBits + 1 is the number of consecutive ones.
+            // 63 - endElementInBits is the following zeros of the right most one.
+            range = -1l >>> (BIT_IN_LONG - (endElementInBits + 1));
+            size -= Long.bitCount(bits[endBitsIndex]);
+            bits[endBitsIndex] |= range;
+            size += Long.bitCount(bits[endBitsIndex]);
+            for(int i = (startBitsIndex + 1); i <= (endBitsIndex - 1); i++) {
                 size -= Long.bitCount(bits[i]);
-                bits[i] = -1L;
+                bits[i] = -1l;
                 size += Long.bitCount(bits[i]);
             }
         }
     }
+    
+    private void calculateElementIndex(E element) {
+        int elementOrdinal = element.ordinal();
+        bitsIndex = elementOrdinal / BIT_IN_LONG;
+        elementInBits = elementOrdinal % BIT_IN_LONG;
+        oldBits = bits[bitsIndex];
+    }
+    
+    private int bitsIndex;
+
+    private int elementInBits;
+
+    private long oldBits;
 }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/MiniEnumSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/MiniEnumSet.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/MiniEnumSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/MiniEnumSet.java Thu Dec 10 11:23:50 2009
@@ -18,7 +18,9 @@
 
 
 /**
- * A concrete EnumSet for enums with 64 or fewer elements.
+ * This is a concrete subclass of EnumSet designed specifically for enum type
+ * with less than or equal to 64 elements.
+ * 
  */
 @SuppressWarnings("serial")
 final class MiniEnumSet<E extends Enum<E>> extends EnumSet<E> {
@@ -37,47 +39,45 @@
     
     private class MiniEnumSetIterator implements Iterator<E> {
 
-        /**
-         * The bits yet to be returned for bits. As values from the current index are returned,
-         * their bits are zeroed out.
-         */
-        private long currentBits = bits;
+        private long unProcessedBits;
 
-        /**
-         * The single bit of the next value to return.
+        /*
+         * Mask for current element.
          */
-        private long mask = currentBits & -currentBits; // the lowest 1 bit in currentBits
+        private long currentElementMask;
 
-        /**
-         * The candidate for removal. If null, no value may be removed.
-         */
-        private E last;
+        private boolean canProcess = true;
+
+        private MiniEnumSetIterator() {
+            unProcessedBits = bits;
+            if (0 == unProcessedBits) {
+                canProcess = false;
+            }
+        }
 
         public boolean hasNext() {
-            return mask != 0;
+            return canProcess;
         }
 
         public E next() {
-            if (mask == 0) {
+            if (!canProcess) {
                 throw new NoSuchElementException();
             }
-
-            int ordinal = Long.numberOfTrailingZeros(mask);
-            last = enums[ordinal];
-
-            currentBits &= ~mask;
-            mask = currentBits & -currentBits; // the lowest 1 bit in currentBits
-
-            return last;
+            currentElementMask = unProcessedBits & (-unProcessedBits);
+            unProcessedBits -= currentElementMask;
+            if (0 == unProcessedBits) {
+                canProcess = false;
+            }
+            return enums[Long.numberOfTrailingZeros(currentElementMask)];
         }
 
         public void remove() {
-            if (last == null) {
+            if ( currentElementMask == 0 ) {
                 throw new IllegalStateException();
             }
-
-            MiniEnumSet.this.remove(last);
-            last = null;
+            bits &= ~currentElementMask;
+            size = Long.bitCount(bits);
+            currentElementMask = 0;
         }
     }
 
@@ -102,83 +102,77 @@
         if (!isValidType(element.getDeclaringClass())) {
             throw new ClassCastException();
         }
-
-        long oldBits = bits;
-        long newBits = oldBits | (1L << element.ordinal());
-        if (oldBits != newBits) {
-            bits = newBits;
-            size++;
-            return true;
+        long mask = 1l << element.ordinal();
+        if ((bits & mask) == mask) {
+            return false;
         }
-        return false;
+        bits |= mask;
+
+        size++;
+        return true;
     }
     
     @Override
     public boolean addAll(Collection<? extends E> collection) {
-        if (collection.isEmpty()) {
+        if (0 == collection.size()) {
             return false;
         }
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
+            EnumSet<?> set = (EnumSet)collection;
             if (!isValidType(set.elementClass)) {
                 throw new ClassCastException();
             }
-
             MiniEnumSet<?> miniSet = (MiniEnumSet<?>) set;
             long oldBits = bits;
-            long newBits = oldBits | miniSet.bits;
-            bits = newBits;
-            size = Long.bitCount(newBits);
-            return (oldBits != newBits);
+            bits |= miniSet.bits;
+            size = Long.bitCount(bits);
+            return (oldBits != bits);
         }
         return super.addAll(collection);
     }
     
     @Override
     public boolean contains(Object object) {
-        if (object == null || !isValidType(object.getClass())) {
+        if (null == object) {
             return false;
         }
-
-        @SuppressWarnings("unchecked") // guarded by isValidType()
-        Enum<E> element = (Enum<E>) object;
+        if (!isValidType(object.getClass())) {
+            return false;
+        }
+        Enum<?> element = (Enum<?>) object;
         int ordinal = element.ordinal();
-        return (bits & (1L << ordinal)) != 0;
+        return (bits & (1l << ordinal)) != 0;
     }
     
     @Override
     public boolean containsAll(Collection<?> collection) {
-        if (collection.isEmpty()) {
+        if (collection.size() == 0) {
             return true;
         }
         if (collection instanceof MiniEnumSet) {
             MiniEnumSet<?> set = (MiniEnumSet<?>) collection;
-            long setBits = set.bits;
-            return isValidType(set.elementClass) && ((bits & setBits) == setBits);
+            return isValidType(set.elementClass ) && ((bits & set.bits) == set.bits);
         }
         return !(collection instanceof EnumSet) && super.containsAll(collection);  
     }
     
     @Override
     public boolean removeAll(Collection<?> collection) {
-        if (collection.isEmpty()) {
+        if (0 == collection.size()) {
             return false;
         }
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
-            if (!isValidType(set.elementClass)) {
-                return false;
-            }
-
-            MiniEnumSet<E> miniSet = (MiniEnumSet<E>) set;
-            long oldBits = bits;
-            long newBits = oldBits & ~miniSet.bits;
-            if (oldBits != newBits) {
-                bits = newBits;
-                size = Long.bitCount(newBits);
-                return true;
+            EnumSet<E> set = (EnumSet<E>) collection;
+            boolean removeSuccessful = false;
+            if (isValidType(set.elementClass)) {
+                long mask = bits & ((MiniEnumSet<E>) set).bits;
+                if (mask != 0) {
+                    bits -= mask;
+                    size = Long.bitCount(bits);
+                    removeSuccessful = true;
+                }
             }
-            return false;
+            return removeSuccessful;
         }
         return super.removeAll(collection);
     }
@@ -186,46 +180,33 @@
     @Override
     public boolean retainAll(Collection<?> collection) {
         if (collection instanceof EnumSet) {
-            EnumSet<?> set = (EnumSet<?>) collection;
+            EnumSet<E> set = (EnumSet<E>) collection;
             if (!isValidType(set.elementClass)) {
-                if (size > 0) {
-                    clear();
-                    return true;
-                } else {
-                    return false;
-                }
+                clear();
+                return true;
             }
-
-            MiniEnumSet<E> miniSet = (MiniEnumSet<E>) set;
+            boolean retainSuccessful = false;
             long oldBits = bits;
-            long newBits = oldBits & miniSet.bits;
-            if (oldBits != newBits) {
-                bits = newBits;
-                size = Long.bitCount(newBits);
-                return true;
+            bits &= ((MiniEnumSet<E>)set).bits;
+            if (oldBits != bits) {
+                size = Long.bitCount(bits);
+                retainSuccessful = true;
             }
-            return false;
+            return retainSuccessful;
         }
         return super.retainAll(collection);
     }
     
     @Override
     public boolean remove(Object object) {
-        if (object == null || !isValidType(object.getClass())) {
+        if (!contains(object)) {
             return false;
         }
-
-        @SuppressWarnings("unchecked") // guarded by isValidType() 
-        Enum<E> element = (Enum<E>) object;
+        Enum<?> element = (Enum<?>) object;
         int ordinal = element.ordinal();
-        long oldBits = bits;
-        long newBits = oldBits & ~(1L << ordinal);
-        if (oldBits != newBits) {
-            bits = newBits;
-            size--;
-            return true;
-        }
-        return false;
+        bits -= (1l << ordinal);
+        size--;
+        return true;
     }
     
     @Override
@@ -233,18 +214,18 @@
         if (!(object instanceof EnumSet)) {
             return super.equals(object);
         }
-        EnumSet<?> set =(EnumSet<?>) object;
-        if (!isValidType(set.elementClass)) {
-            return size == 0 && set.isEmpty();
+        EnumSet<?> set =(EnumSet<?>)object; 
+        if( !isValidType(set.elementClass) ) {
+            return size == 0 && set.size() == 0;
         }
-        return bits == ((MiniEnumSet<?>) set).bits;
+        return bits == ((MiniEnumSet<?>)set).bits;
     }
     
     @Override
     void complement() {
-        if (enums.length != 0) {
+        if (0 != enums.length) {
             bits = ~bits;
-            bits &= (-1L >>> (MAX_ELEMENTS - enums.length));
+            bits &= (-1l >>> (MAX_ELEMENTS - enums.length));
             size = enums.length - size;
         }
     }
@@ -252,7 +233,7 @@
     @Override
     void setRange(E start, E end) {
         int length = end.ordinal() - start.ordinal() + 1;
-        long range = (-1L >>> (MAX_ELEMENTS - length)) << start.ordinal();
+        long range = (-1l >>> (MAX_ELEMENTS - length)) << start.ordinal();
         bits |= range;
         size = Long.bitCount(bits);
     }

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeMap.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeMap.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeMap.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeMap.java Thu Dec 10 11:23:50 2009
@@ -5465,9 +5465,6 @@
 
     @SuppressWarnings("unchecked")
     private static <T> Comparable<T> toComparable(T obj) {
-        if (obj == null) {
-            throw new NullPointerException();
-        }
         return (Comparable<T>) obj;
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeSet.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeSet.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/util/TreeSet.java Thu Dec 10 11:23:50 2009
@@ -35,12 +35,11 @@
 
     private static final long serialVersionUID = -2479143000061671589L;
 
-    /** Keys are this set's elements. Values are always Boolean.TRUE */
-    transient NavigableMap<E, Object> backingMap;
+    transient NavigableMap<E, E> backingMap;
 
     transient NavigableSet<E> descendingSet;
 
-    TreeSet(NavigableMap<E, Object> map) {
+    TreeSet(NavigableMap<E, E> map) {
         backingMap = map;
     }
 
@@ -49,7 +48,7 @@
      * ordering.
      */
     public TreeSet() {
-        backingMap = new TreeMap<E, Object>();
+        backingMap = new TreeMap<E, E>();
     }
 
     /**
@@ -76,7 +75,7 @@
      *            the comparator to use.
      */
     public TreeSet(Comparator<? super E> comparator) {
-        backingMap = new TreeMap<E, Object>(comparator);
+        backingMap = new TreeMap<E, E>(comparator);
     }
 
     /**
@@ -110,7 +109,7 @@
      */
     @Override
     public boolean add(E object) {
-        return backingMap.put(object, Boolean.TRUE) == null;
+        return backingMap.put(object, object) == null;
     }
 
     /**
@@ -156,10 +155,10 @@
         try {
             TreeSet<E> clone = (TreeSet<E>) super.clone();
             if (backingMap instanceof TreeMap) {
-                clone.backingMap = (NavigableMap<E, Object>) ((TreeMap<E, Object>) backingMap)
+                clone.backingMap = (NavigableMap<E, E>) ((TreeMap<E, E>) backingMap)
                         .clone();
             } else {
-                clone.backingMap = new TreeMap<E, Object>(backingMap);
+                clone.backingMap = new TreeMap<E, E>(backingMap);
             }
             return clone;
         } catch (CloneNotSupportedException e) {
@@ -287,7 +286,7 @@
      * @since 1.6
      */
     public E pollFirst() {
-        Map.Entry<E, Object> entry = backingMap.pollFirstEntry();
+        Map.Entry<E, E> entry = backingMap.pollFirstEntry();
         return (null == entry) ? null : entry.getKey();
     }
 
@@ -298,7 +297,7 @@
      * @since 1.6
      */
     public E pollLast() {
-        Map.Entry<E, Object> entry = backingMap.pollLastEntry();
+        Map.Entry<E, E> entry = backingMap.pollLastEntry();
         return (null == entry) ? null : entry.getKey();
     }
 
@@ -494,14 +493,14 @@
     private void readObject(ObjectInputStream stream) throws IOException,
             ClassNotFoundException {
         stream.defaultReadObject();
-        TreeMap<E, Object> map = new TreeMap<E, Object>(
-                (Comparator<? super E>) stream.readObject());
+        TreeMap<E, E> map = new TreeMap<E, E>((Comparator<? super E>) stream
+                .readObject());
         int size = stream.readInt();
         if (size > 0) {
-            TreeMap.Node<E, Object> lastNode = null;
+            TreeMap.Node<E,E> lastNode = null;
             for(int i=0; i<size; i++) {
                 E elem = (E)stream.readObject();
-                lastNode = map.addToLast(lastNode,elem, Boolean.TRUE);
+                lastNode = map.addToLast(lastNode,elem,elem);
             }
         }
         backingMap = map;

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/fdlibm.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/fdlibm.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/fdlibm.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/gp.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/gp.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/gp.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hymagic.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hymagic.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hymagic.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hysocket.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hysocket.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hysocket.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/hyvmls.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hyvmls.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/hyvmls.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jni_types.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni_types.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jni_types.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmpi.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmpi.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmpi.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmri.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmri.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmri.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/jvmti_types.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti_types.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/jvmti_types.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmi.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmi.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmi.h:803062-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/include/vmizip.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmizip.h:803062-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/include/vmizip.h:803062-885602

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/SerializationStressTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/SerializationStressTest.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/SerializationStressTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/SerializationStressTest.java Thu Dec 10 11:23:50 2009
@@ -58,8 +58,6 @@
 import java.util.TreeSet;
 import java.util.Vector;
 
-import org.apache.harmony.luni.util.InputStreamHelper;
-
 /**
  * Automated Test Suite for class java.io.ObjectOutputStream
  * 
@@ -660,25 +658,33 @@
 		assertTrue("resolved class 3", resolvedClasses[2] == Number.class);
 	}
 
-    public void test_reset() throws IOException, ClassNotFoundException {
-        oos.reset();
-        oos.writeObject("R");
-        oos.reset();
-        oos.writeByte(24);
-        oos.close();
-
-        DataInputStream dis = new DataInputStream(loadStream());
-        byte[] input = InputStreamHelper.readFullyAndClose(dis);
-        byte[] result = new byte[] { (byte) 0xac, (byte) 0xed, (byte) 0,
-                (byte) 5, (byte) 0x79, (byte) 0x74, (byte) 0, (byte) 1,
-                (byte) 'R', (byte) 0x79, (byte) 0x77, (byte) 1, (byte) 24 };
-        assertTrue("incorrect output", Arrays.equals(input, result));
-
-        ois = new ObjectInputStreamSubclass(loadStream());
-        assertEquals("Wrong result from readObject()", "R", ois.readObject());
-        assertEquals("Wrong result from readByte()", 24, ois.readByte());
-        ois.close();
-    }
+	public void test_reset() {
+		try {
+			oos.reset();
+			oos.writeObject("R");
+			oos.reset();
+			oos.writeByte(24);
+			oos.close();
+
+			DataInputStream dis = new DataInputStream(loadStream());
+			byte[] input = new byte[dis.available()];
+			dis.readFully(input);
+			byte[] result = new byte[] { (byte) 0xac, (byte) 0xed, (byte) 0,
+					(byte) 5, (byte) 0x79, (byte) 0x74, (byte) 0, (byte) 1,
+					(byte) 'R', (byte) 0x79, (byte) 0x77, (byte) 1, (byte) 24 };
+			assertTrue("incorrect output", Arrays.equals(input, result));
+
+			ois = new ObjectInputStreamSubclass(loadStream());
+			assertEquals("Wrong result from readObject()", "R", ois.readObject()
+					);
+			assertEquals("Wrong result from readByte()", 24, ois.readByte());
+			ois.close();
+		} catch (IOException e1) {
+			fail("IOException : " + e1.getMessage());
+		} catch (ClassNotFoundException e2) {
+			fail("ClassNotFoundException : " + e2.getMessage());
+		}
+	}
 
 	public void test_serialVersionUID(Class clazz, long svUID) throws Exception {
 		final String idWrong = "serialVersionUID is wrong for: ";

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java Thu Dec 10 11:23:50 2009
@@ -19,7 +19,6 @@
 
 import java.util.AbstractMap;
 import java.util.AbstractSet;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -356,57 +355,6 @@
         assertEquals("Should be equal", amt, ht);
     }
 
-    public void testEqualsWithNullValues() {
-        Map<String, String> a = new HashMap<String, String>();
-        a.put("a", null);
-        a.put("b", null);
-
-        Map<String, String> b = new HashMap<String, String>();
-        a.put("c", "cat");
-        a.put("d", "dog");
-
-        assertFalse(a.equals(b));
-        assertFalse(b.equals(a));
-    }
-
-    public void testNullsOnViews() {
-        Map<String, String> nullHostile = new Hashtable<String, String>();
-
-        nullHostile.put("a", "apple");
-        testNullsOnView(nullHostile.entrySet());
-
-        nullHostile.put("a", "apple");
-        testNullsOnView(nullHostile.keySet());
-
-        nullHostile.put("a", "apple");
-        testNullsOnView(nullHostile.values());
-    }
-
-    private void testNullsOnView(Collection<?> view) {
-        try {
-            assertFalse(view.contains(null));
-        } catch (NullPointerException optional) {
-        }
-
-        try {
-            assertFalse(view.remove(null));
-        } catch (NullPointerException optional) {
-        }
-
-        Set<Object> setOfNull = Collections.singleton(null);
-        assertFalse(view.equals(setOfNull));
-
-        try {
-            assertFalse(view.removeAll(setOfNull));
-        } catch (NullPointerException optional) {
-        }
-
-        try {
-            assertTrue(view.retainAll(setOfNull)); // destructive
-        } catch (NullPointerException optional) {
-        }
-    }
-
     protected void setUp() {
     }
 

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/util/EnumSetTest.java Thu Dec 10 11:23:50 2009
@@ -137,25 +137,6 @@
         }
     }
 
-    public void testRemoveIteratorRemoveFromHugeEnumSet() {
-        EnumSet<HugeEnumCount> set = EnumSet.noneOf(HugeEnumCount.class);
-        set.add(HugeEnumCount.NO64);
-        set.add(HugeEnumCount.NO65);
-        set.add(HugeEnumCount.NO128);
-        Iterator<HugeEnumCount> iterator = set.iterator();
-        assertTrue(iterator.hasNext());
-        assertEquals(HugeEnumCount.NO64, iterator.next());
-        assertTrue(iterator.hasNext());
-        iterator.remove();
-        assertEquals(HugeEnumCount.NO65, iterator.next());
-        assertTrue(iterator.hasNext());
-        assertEquals(HugeEnumCount.NO128, iterator.next());
-        assertFalse(iterator.hasNext());
-        assertEquals(EnumSet.of(HugeEnumCount.NO65, HugeEnumCount.NO128), set);
-        iterator.remove();
-        assertEquals(EnumSet.of(HugeEnumCount.NO65), set);
-    }
-
     /**
      * @tests java.util.EnumSet#allOf(java.lang.Class)
      */
@@ -1239,21 +1220,21 @@
         Set<EnumWithInnerClass> setWithInnerClass = EnumSet
                 .allOf(EnumWithInnerClass.class);
         result = set.retainAll(setWithInnerClass);
-        assertFalse("Should return false", result); //$NON-NLS-1$
+        assertTrue("Should return true", result); //$NON-NLS-1$
         assertEquals("Size of set should be 0", 0, set.size()); //$NON-NLS-1$
 
         setWithInnerClass = EnumSet.noneOf(EnumWithInnerClass.class);
         result = set.retainAll(setWithInnerClass);
-        assertFalse("Should return false", result); //$NON-NLS-1$
+        assertTrue("Should return true", result); //$NON-NLS-1$
 
         Set<EmptyEnum> emptySet = EnumSet.allOf(EmptyEnum.class);
         result = set.retainAll(emptySet);
-        assertFalse("Should return false", result); //$NON-NLS-1$
+        assertTrue("Should return true", result); //$NON-NLS-1$
 
         Set<EnumWithAllInnerClass> setWithAllInnerClass = EnumSet
                 .allOf(EnumWithAllInnerClass.class);
         result = set.retainAll(setWithAllInnerClass);
-        assertFalse("Should return false", result); //$NON-NLS-1$
+        assertTrue("Should return true", result); //$NON-NLS-1$
 
         set.add(EnumFoo.a);
         result = set.retainAll(setWithInnerClass);
@@ -1333,17 +1314,17 @@
         Set<HugeEnumWithInnerClass> hugeSetWithInnerClass = EnumSet
                 .allOf(HugeEnumWithInnerClass.class);
         result = hugeSet.retainAll(hugeSetWithInnerClass);
-        assertFalse(result);
+        assertTrue(result);
         assertEquals(0, hugeSet.size());
 
         hugeSetWithInnerClass = EnumSet.noneOf(HugeEnumWithInnerClass.class);
         result = hugeSet.retainAll(hugeSetWithInnerClass);
-        assertFalse(result);
+        assertTrue(result);
 
         Set<HugeEnumWithInnerClass> hugeSetWithAllInnerClass = EnumSet
                 .allOf(HugeEnumWithInnerClass.class);
         result = hugeSet.retainAll(hugeSetWithAllInnerClass);
-        assertFalse(result);
+        assertTrue(result);
 
         hugeSet.add(HugeEnum.a);
         result = hugeSet.retainAll(hugeSetWithInnerClass);

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java Thu Dec 10 11:23:50 2009
@@ -368,8 +368,7 @@
 		super.tearDown();
 	}
 
-    public void test_getCanonicalPath() throws IOException,
-                                               InterruptedException {
+    public void test_getCanonicalPath() throws IOException {
         File tmpFolder1 = new File("folder1");
         tmpFolder1.mkdirs();
         tmpFolder1.deleteOnExit();
@@ -387,8 +386,7 @@
         tmpFolder4.deleteOnExit();
 
         // make a link to folder1/folder2
-        Process ln = Runtime.getRuntime().exec("ln -s folder1/folder2 folder2");
-        ln.waitFor();
+        Runtime.getRuntime().exec("ln -s folder1/folder2 folder2");
         File linkFile = new File("folder2");
         linkFile.deleteOnExit();
 

Propchange: harmony/enhanced/classlib/branches/java6/modules/luni/src/test/resources/net.resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/net.resources:790472-889062
+/harmony/enhanced/classlib/trunk/modules/luni/src/test/resources/net.resources:790472-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/depends/manifests/asm-3.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/pack200/depends/manifests/asm-3.1:785554-889062
+/harmony/enhanced/classlib/trunk/modules/pack200/depends/manifests/asm-3.1:785554-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java:782694-889062
+/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200Adapter.java:782694-885602

Propchange: harmony/enhanced/classlib/branches/java6/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 10 11:23:50 2009
@@ -1 +1 @@
-/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java:782694-889062
+/harmony/enhanced/classlib/trunk/modules/pack200/src/main/java5/org/apache/harmony/pack200/Pack200PackerAdapter.java:782694-885602

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=889194&r1=889193&r2=889194&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 Thu Dec 10 11:23:50 2009
@@ -23,7 +23,6 @@
  javax.net,
  javax.net.ssl,
  org.apache.harmony.kernel.vm,
- org.apache.harmony.luni.util,
  org.apache.harmony.testframework.serialization;hy_usage=test;resolution:=optional
 Export-Package: java.rmi,
  java.rmi.activation,

Modified: harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/java/rmi/server/RMIClassLoader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/java/rmi/server/RMIClassLoader.java?rev=889194&r1=889193&r2=889194&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/java/rmi/server/RMIClassLoader.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/rmi/src/main/java/java/rmi/server/RMIClassLoader.java Thu Dec 10 11:23:50 2009
@@ -29,7 +29,6 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import org.apache.harmony.luni.util.InputStreamHelper;
 import org.apache.harmony.rmi.DefaultRMIClassLoaderSpi;
 import org.apache.harmony.rmi.internal.nls.Messages;
 
@@ -211,7 +210,9 @@
             // resource not found
             return null;
         }
-        byte[] buf = InputStreamHelper.readFullyAndClose(in);
+        Object obj = null;
+        byte[] buf = new byte[in.available()];
+        in.read(buf);
         String str = new String(buf, "UTF-8"); //$NON-NLS-1$
         StringTokenizer tok = new StringTokenizer(str, "\n\r"); //$NON-NLS-1$
 



Mime
View raw message