harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r466154 - in /incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent: ./ locks/
Date Fri, 20 Oct 2006 15:47:51 GMT
Author: hindessm
Date: Fri Oct 20 08:47:50 2006
New Revision: 466154

URL: http://svn.apache.org/viewvc?view=rev&rev=466154
Log:
Applied two patches from "[#HARMONY-1926] [build] A lot of "never used"
and "never read" warning messages".

Modified:
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Executors.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantLock.java
    incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ArrayBlockingQueue.java
Fri Oct 20 08:47:50 2006
@@ -549,7 +549,6 @@
         try {
             int i = takeIndex;
             int n = 0;
-            int sz = count;
             int max = (maxElements < count)? maxElements : count;
             while (n < max) {
                 c.add(items[i]);

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ConcurrentHashMap.java
Fri Oct 20 08:47:50 2006
@@ -23,8 +23,6 @@
 import java.util.*;
 import java.io.Serializable;
 import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 
 /**
  * A hash table supporting full concurrency of retrievals and
@@ -726,10 +724,8 @@
         final Segment[] segments = this.segments;
         int[] mc = new int[segments.length];
         for (;;) {
-            int sum = 0;
             int mcsum = 0;
             for (int i = 0; i < segments.length; ++i) {
-                int c = segments[i].count;
                 mcsum += mc[i] = segments[i].modCount;
                 if (segments[i].containsValue(value))
                     return true;
@@ -737,7 +733,6 @@
             boolean cleanSweep = true;
             if (mcsum != 0) {
                 for (int i = 0; i < segments.length; ++i) {
-                    int c = segments[i].count;
                     if (mc[i] != segments[i].modCount) {
                         cleanSweep = false;
                         break;

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/CountDownLatch.java
Fri Oct 20 08:47:50 2006
@@ -6,7 +6,6 @@
 
 package java.util.concurrent;
 import java.util.concurrent.locks.*;
-import java.util.concurrent.atomic.*;
 
 /**
  * A synchronization aid that allows one or more threads to wait until
@@ -128,6 +127,9 @@
      * Uses AQS state to represent count.
      */
     private static final class Sync extends AbstractQueuedSynchronizer {
+
+        private static final long serialVersionUID = 4982264981922014374L;
+
         Sync(int count) {
             setState(count); 
         }

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/DelayQueue.java
Fri Oct 20 08:47:50 2006
@@ -120,9 +120,7 @@
                     available.await();
                 } else {
                     long delay =  first.getDelay(TimeUnit.NANOSECONDS);
-                    if (delay > 0) {
-                        long tl = available.awaitNanos(delay);
-                    } else {
+                    if (delay <= 0) {
                         E x = q.poll();
                         assert x != null;
                         if (q.size() != 0)

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Delayed.java
Fri Oct 20 08:47:50 2006
@@ -6,8 +6,6 @@
 
 package java.util.concurrent;
 
-import java.util.*;
-
 /**
  * A mix-in style interface for marking objects that should be
  * acted upon after a given delay.

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ExecutorService.java
Fri Oct 20 08:47:50 2006
@@ -8,8 +8,6 @@
 
 import java.util.List;
 import java.util.Collection;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
 
 /**
  * An {@link Executor} that provides methods to manage termination and

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Executors.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Executors.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Executors.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Executors.java
Fri Oct 20 08:47:50 2006
@@ -11,7 +11,6 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedExceptionAction;
-import java.security.AccessControlException;
 
 /**
  * Factory and utility methods for {@link Executor}, {@link

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/FutureTask.java
Fri Oct 20 08:47:50 2006
@@ -143,6 +143,9 @@
      * Uses AQS sync state to represent run status
      */
     private final class Sync extends AbstractQueuedSynchronizer {
+
+        private static final long serialVersionUID = -7828117401763700385L;
+
         /** State value representing that task is running */
         private static final int RUNNING   = 1;
         /** State value representing that task ran */

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/ScheduledExecutorService.java
Fri Oct 20 08:47:50 2006
@@ -5,8 +5,6 @@
  */
 
 package java.util.concurrent;
-import java.util.concurrent.atomic.*;
-import java.util.*;
 
 /**
  * An {@link ExecutorService} that can schedule commands to run after a given

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/Semaphore.java
Fri Oct 20 08:47:50 2006
@@ -7,7 +7,6 @@
 package java.util.concurrent;
 import java.util.*;
 import java.util.concurrent.locks.*;
-import java.util.concurrent.atomic.*;
 
 /**
  * A counting semaphore.  Conceptually, a semaphore maintains a set of
@@ -178,6 +177,9 @@
      * NonFair version
      */
     final static class NonfairSync extends Sync {
+
+        private static final long serialVersionUID = -2694183684443567898L;
+
         NonfairSync(int permits) {
             super(permits);
         }
@@ -191,6 +193,9 @@
      * Fair version
      */
     final static class FairSync extends Sync {
+
+        private static final long serialVersionUID = 2014338818796000944L;
+
         FairSync(int permits) {
             super(permits);
         }

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/SynchronousQueue.java
Fri Oct 20 08:47:50 2006
@@ -177,6 +177,9 @@
      *  0 for waiting, 1 for ack, -1 for cancelled.
      */
     static final class Node extends AbstractQueuedSynchronizer {
+
+        private static final long serialVersionUID = -2631493897867746127L;
+
         /** Synchronization state value representing that node acked */
         private static final int ACK    =  1;
         /** Synchronization state value representing that node cancelled */

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/AbstractQueuedSynchronizer.java
Fri Oct 20 08:47:50 2006
@@ -7,7 +7,6 @@
 package java.util.concurrent.locks;
 import java.util.*;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 import sun.misc.Unsafe;
 
 /**

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/LockSupport.java
Fri Oct 20 08:47:50 2006
@@ -5,7 +5,6 @@
  */
 
 package java.util.concurrent.locks;
-import java.util.concurrent.*;
 import sun.misc.Unsafe;
 
 

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantLock.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantLock.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantLock.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantLock.java
Fri Oct 20 08:47:50 2006
@@ -7,7 +7,6 @@
 package java.util.concurrent.locks;
 import java.util.*;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 
 /**
  * A reentrant mutual exclusion {@link Lock} with the same basic
@@ -169,6 +168,9 @@
      * Sync object for non-fair locks
      */
     final static class NonfairSync extends Sync {
+
+        private static final long serialVersionUID = 7316153563782823691L;
+
         /**
          * Perform lock.  Try immediate barge, backing up to normal
          * acquire on failure.
@@ -189,6 +191,9 @@
      * Sync object for fair locks
      */
     final static class FairSync  extends Sync {
+
+        private static final long serialVersionUID = -3000897897090466540L;
+
         final void lock() { 
             acquire(1); 
         }

Modified: incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java
URL: http://svn.apache.org/viewvc/incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java?view=diff&rev=466154&r1=466153&r2=466154
==============================================================================
--- incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java
(original)
+++ incubator/harmony/standard/classlib/trunk/modules/concurrent/src/main/java/java/util/concurrent/locks/ReentrantReadWriteLock.java
Fri Oct 20 08:47:50 2006
@@ -6,7 +6,6 @@
 
 package java.util.concurrent.locks;
 import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
 import java.util.*;
 
 /**
@@ -325,6 +324,9 @@
      * Nonfair version of Sync
      */
     final static class NonfairSync extends Sync {
+
+        private static final long serialVersionUID = -8159625535654395037L;
+
         protected final boolean tryAcquire(int acquires) { 
             return nonfairTryAcquire(acquires);
         }
@@ -346,6 +348,9 @@
      * Fair version of Sync
      */
     final static class FairSync extends Sync {
+
+        private static final long serialVersionUID = -2274990926593161451L;
+
         protected final boolean tryAcquire(int acquires) { 
             // mask out readlocks if called from condition methods
             acquires = exclusiveCount(acquires);



Mime
View raw message