river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter_firmst...@apache.org
Subject svn commit: r1634322 [41/41] - in /river/jtsk/skunk/qa_refactor/trunk: qa/src/com/sun/jini/qa/harness/ qa/src/com/sun/jini/test/impl/end2end/e2etest/ qa/src/com/sun/jini/test/impl/joinmanager/ qa/src/com/sun/jini/test/impl/mahalo/ qa/src/com/sun/jini/t...
Date Sun, 26 Oct 2014 13:17:31 GMT
Modified: river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/util/FutureObserver.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/util/FutureObserver.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/util/FutureObserver.java (original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/api/util/FutureObserver.java Sun
Oct 26 13:17:28 2014
@@ -37,23 +37,5 @@ public interface FutureObserver<T> exten
          * @return true if observer was added, false otherwise.
          */
         public boolean addObserver(FutureObserver<T> observer);
-    }
-    
-    public interface Subscriber<T> {
-    
-        /**
-         * Prior to completion, if a Future sets off additional
-         * ObservableFuture tasks, these may be recommended for 
-         * Subscribers to Observe.
-         * 
-         * @param e
-         */
-        public void reccommendedViewing(ObservableFuture<T> e);
-    }
-    
-    public interface Subscribeable<T>{
-        
-        public void subscribe(Subscriber<T> subscriber);
-    }
-    
+    }  
 }

Modified: river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/DependencyLinker.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/DependencyLinker.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/DependencyLinker.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/DependencyLinker.java
Sun Oct 26 13:17:28 2014
@@ -19,6 +19,7 @@
 package org.apache.river.impl.thread;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
@@ -41,8 +42,8 @@ public class DependencyLinker implements
     }
 
     public synchronized void register() {
-        int l = tasks.size();
-        for (int i = 0; i < l; i++){
+        // Iterator causes ConcurrentModificationException
+        for (int i = 0, l = tasks.size(); i < l; i++){
             ObservableFuture f = null;
             try {
                 f = tasks.get(i);

Modified: river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java
Sun Oct 26 13:17:28 2014
@@ -24,9 +24,7 @@ import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.FutureTask;
 import org.apache.river.api.util.FutureObserver;
-import org.apache.river.api.util.FutureObserver.Subscribeable;
 import org.apache.river.api.util.FutureObserver.ObservableFuture;
-import org.apache.river.api.util.FutureObserver.Subscriber;
 
 /**
  *
@@ -39,17 +37,11 @@ public class ObservableFutureTask<T> ext
     public ObservableFutureTask(Callable<T> callable) {
         super(callable);
         listeners = new LinkedList<FutureObserver<T>>();
-        if (callable instanceof Subscribeable){
-            ((Subscribeable<T>) callable).subscribe(new FutureSubscriber(listeners));
-        }
     }
     
     public ObservableFutureTask(Runnable r, T result){
         super(r,result);
         listeners = new LinkedList<FutureObserver<T>>();
-        if (r instanceof Subscribeable){
-            ((Subscribeable<T>) r).subscribe(new FutureSubscriber(listeners));
-        }
     }
     
     @Override
@@ -75,25 +67,4 @@ public class ObservableFutureTask<T> ext
         }
     }
     
-    private static final class FutureSubscriber<T> implements Subscriber<T> {
-        /* Shared list of subscribers */
-        public final List<FutureObserver<T>> listeners;
-        
-        FutureSubscriber(List<FutureObserver<T>> listeners){
-            this.listeners = listeners;
-        }
-        @Override
-        public void reccommendedViewing(ObservableFuture<T> e) {
-            synchronized (listeners){
-                Iterator<FutureObserver<T>> it = listeners.iterator();
-                while (it.hasNext()){
-                    FutureObserver<T> future = it.next();
-                    if (future instanceof Subscriber){
-                        Subscriber<T> subscriber = (Subscriber<T>) future;
-                        subscriber.reccommendedViewing(e);
-                    }
-                }
-            }
-        }
-    }
 }

Modified: river/jtsk/skunk/qa_refactor/trunk/test/src/net/jini/core/discovery/LookupLocatorTest.java
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/test/src/net/jini/core/discovery/LookupLocatorTest.java?rev=1634322&r1=1634321&r2=1634322&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/test/src/net/jini/core/discovery/LookupLocatorTest.java
(original)
+++ river/jtsk/skunk/qa_refactor/trunk/test/src/net/jini/core/discovery/LookupLocatorTest.java
Sun Oct 26 13:17:28 2014
@@ -5,7 +5,6 @@
 package net.jini.core.discovery;
 
 import java.net.MalformedURLException;
-import net.jini.core.lookup.ServiceRegistrar;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;



Mime
View raw message