You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/04/12 17:24:54 UTC

[isis] branch master updated: ISIS-1935 fixes incorrect hasPosted state

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 95a15a2  ISIS-1935 fixes incorrect hasPosted state
95a15a2 is described below

commit 95a15a2884dd0ebbed8417c74ae1ea72fe091ba5
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Apr 12 19:24:51 2018 +0200

    ISIS-1935 fixes incorrect hasPosted state
---
 .../apache/isis/applib/services/eventbus/EventBusService.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
index ecdf49e..8b66e21 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/EventBusService.java
@@ -86,7 +86,7 @@ public abstract class EventBusService {
     @Programmatic
     @PostConstruct
     public void init(final Map<String, String> properties) {
-        // no-op
+    	hasPosted = false; // reset state
     }
 
     @Programmatic
@@ -187,6 +187,7 @@ public abstract class EventBusService {
     // -- subscribers
 
     private final Set<Object> subscribers = _Sets.newConcurrentHashSet();
+	
 
     /**
      * Returns an immutable snapshot of the current subscribers.
@@ -195,9 +196,10 @@ public abstract class EventBusService {
     public Set<Object> getSubscribers() {
         return Collections.unmodifiableSet(_Sets.newLinkedHashSet(subscribers));
     }
-    
 
     // -- post
+    
+    private boolean hasPosted;
 
     /**
      * Post an event.
@@ -208,11 +210,12 @@ public abstract class EventBusService {
             return;
         }
         getEventBusImplementation().post(event);
+        hasPosted = true;
     }
 
 
     protected boolean hasPosted() {
-        return this.eventBusImplementation != null;
+        return hasPosted;
     }
 
     // -- getEventBus

-- 
To stop receiving notification emails like this one, please contact
ahuber@apache.org.