harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r800272 - in /harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent: CopyOnWriteArrayList.java Java6Arrays.java ScheduledThreadPoolExecutor.java TimeUnit.java
Date Mon, 03 Aug 2009 09:50:30 GMT
Author: hindessm
Date: Mon Aug  3 09:50:29 2009
New Revision: 800272

URL: http://svn.apache.org/viewvc?rev=800272&view=rev
Log:
Revert some java5 concurrent changes.

Removed:
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/Java6Arrays.java
Modified:
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
    harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java

Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java?rev=800272&r1=800271&r2=800272&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/CopyOnWriteArrayList.java
Mon Aug  3 09:50:29 2009
@@ -17,8 +17,6 @@
 package java.util.concurrent;
 import java.util.*;
 import java.util.concurrent.locks.*;
-import java.lang.reflect.Array;
-
 import sun.misc.Unsafe;
 
 /**
@@ -102,7 +100,7 @@
         Object[] elements = c.toArray();
         // c.toArray might (incorrectly) not return Object[] (see 6260652)
         if (elements.getClass() != Object[].class)
-            elements = Java6Arrays.copyOf(elements, elements.length, Object[].class);
+            elements = Arrays.copyOf(elements, elements.length, Object[].class);
         setArray(elements);
     }
 
@@ -114,7 +112,7 @@
      * @throws NullPointerException if the specified array is null
      */
     public CopyOnWriteArrayList(E[] toCopyIn) {
-        setArray(Java6Arrays.copyOf(toCopyIn, toCopyIn.length, Object[].class));
+        setArray(Arrays.copyOf(toCopyIn, toCopyIn.length, Object[].class));
     }
 
     /**
@@ -288,7 +286,7 @@
      */
     public Object[] toArray() {
         Object[] elements = getArray();
-        return Java6Arrays.copyOf(elements, elements.length);
+        return Arrays.copyOf(elements, elements.length);
     }
 
     /**
@@ -335,7 +333,7 @@
         Object[] elements = getArray();
         int len = elements.length;
         if (a.length < len)
-            return (T[]) Java6Arrays.copyOf(elements, len, a.getClass());
+            return (T[]) Arrays.copyOf(elements, len, a.getClass());
         else {
             System.arraycopy(elements, 0, a, 0, len);
             if (a.length > len)
@@ -375,7 +373,7 @@
 
             if (oldValue != element) {
                 int len = elements.length;
-                Object[] newElements = Java6Arrays.copyOf(elements, len);
+                Object[] newElements = Arrays.copyOf(elements, len);
                 newElements[index] = element;
                 setArray(newElements);
             } else {
@@ -400,7 +398,7 @@
         try {
             Object[] elements = getArray();
             int len = elements.length;
-            Object[] newElements = Java6Arrays.copyOf(elements, len + 1);
+            Object[] newElements = Arrays.copyOf(elements, len + 1);
             newElements[len] = e;
             setArray(newElements);
             return true;
@@ -428,7 +426,7 @@
             Object[] newElements;
             int numMoved = len - index;
             if (numMoved == 0)
-                newElements = Java6Arrays.copyOf(elements, len + 1);
+                newElements = Arrays.copyOf(elements, len + 1);
             else {
                 newElements = new Object[len + 1];
                 System.arraycopy(elements, 0, newElements, 0, index);
@@ -458,7 +456,7 @@
             E oldValue = get(elements, index);
             int numMoved = len - index - 1;
             if (numMoved == 0)
-                setArray(Java6Arrays.copyOf(elements, len - 1));
+                setArray(Arrays.copyOf(elements, len - 1));
             else {
                 Object[] newElements = new Object[len - 1];
                 System.arraycopy(elements, 0, newElements, 0, index);
@@ -544,7 +542,7 @@
             int newlen = len - (toIndex - fromIndex);
             int numMoved = len - toIndex;
             if (numMoved == 0)
-                setArray(Java6Arrays.copyOf(elements, newlen));
+                setArray(Arrays.copyOf(elements, newlen));
             else {
                 Object[] newElements = new Object[newlen];
                 System.arraycopy(elements, 0, newElements, 0, fromIndex);
@@ -636,7 +634,7 @@
                         temp[newlen++] = element;
                 }
                 if (newlen != len) {
-                    setArray(Java6Arrays.copyOf(temp, newlen));
+                    setArray(Arrays.copyOf(temp, newlen));
                     return true;
                 }
             }
@@ -676,7 +674,7 @@
                         temp[newlen++] = element;
                 }
                 if (newlen != len) {
-                    setArray(Java6Arrays.copyOf(temp, newlen));
+                    setArray(Arrays.copyOf(temp, newlen));
                     return true;
                 }
             }
@@ -715,7 +713,7 @@
                     uniq[added++] = e;
             }
             if (added > 0) {
-                Object[] newElements = Java6Arrays.copyOf(elements, len + added);
+                Object[] newElements = Arrays.copyOf(elements, len + added);
                 System.arraycopy(uniq, 0, newElements, len, added);
                 setArray(newElements);
             }
@@ -758,7 +756,7 @@
         try {
             Object[] elements = getArray();
             int len = elements.length;
-            Object[] newElements = Java6Arrays.copyOf(elements, len + cs.length);
+            Object[] newElements = Arrays.copyOf(elements, len + cs.length);
             System.arraycopy(cs, 0, newElements, len, cs.length);
             setArray(newElements);
             return true;
@@ -798,7 +796,7 @@
             int numMoved = len - index;
             Object[] newElements;
             if (numMoved == 0)
-                newElements = Java6Arrays.copyOf(elements, len + cs.length);
+                newElements = Arrays.copyOf(elements, len + cs.length);
             else {
                 newElements = new Object[len + cs.length];
                 System.arraycopy(elements, 0, newElements, 0, index);

Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java?rev=800272&r1=800271&r2=800272&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/ScheduledThreadPoolExecutor.java
Mon Aug  3 09:50:29 2009
@@ -773,7 +773,7 @@
             int newCapacity = oldCapacity + (oldCapacity >> 1); // grow 50%
             if (newCapacity < 0) // overflow
                 newCapacity = Integer.MAX_VALUE;
-            queue = Java6Arrays.copyOf(queue, newCapacity);
+            queue = Arrays.copyOf(queue, newCapacity);
         }
 
         /**
@@ -1074,7 +1074,7 @@
             final ReentrantLock lock = this.lock;
             lock.lock();
             try {
-                return Java6Arrays.copyOf(queue, size, Object[].class);
+                return Arrays.copyOf(queue, size, Object[].class);
             } finally {
                 lock.unlock();
             }
@@ -1086,7 +1086,7 @@
             lock.lock();
             try {
                 if (a.length < size)
-                    return (T[]) Java6Arrays.copyOf(queue, size, a.getClass());
+                    return (T[]) Arrays.copyOf(queue, size, a.getClass());
                 System.arraycopy(queue, 0, a, 0, size);
                 if (a.length > size)
                     a[size] = null;
@@ -1097,7 +1097,7 @@
         }
 
         public Iterator<Runnable> iterator() {
-            return new Itr(Java6Arrays.copyOf(queue, size));
+            return new Itr(Arrays.copyOf(queue, size));
         }
 
         /**

Modified: harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java?rev=800272&r1=800271&r2=800272&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/concurrent/src/main/java/java/util/concurrent/TimeUnit.java
Mon Aug  3 09:50:29 2009
@@ -222,8 +222,9 @@
      * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
      * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
      * @see #convert
+     * @since 1.6
      */
-    long toMinutes(long duration) {
+    public long toMinutes(long duration) {
         throw new AbstractMethodError();
     }
 
@@ -234,8 +235,9 @@
      * or <tt>Long.MIN_VALUE</tt> if conversion would negatively
      * overflow, or <tt>Long.MAX_VALUE</tt> if it would positively overflow.
      * @see #convert
+     * @since 1.6
      */
-    long toHours(long duration) {
+    public long toHours(long duration) {
         throw new AbstractMethodError();
     }
 
@@ -244,8 +246,9 @@
      * @param duration the duration
      * @return the converted duration
      * @see #convert
+     * @since 1.6
      */
-    long toDays(long duration) {
+    public long toDays(long duration) {
         throw new AbstractMethodError();
     }
 



Mime
View raw message