You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2016/09/28 19:59:11 UTC
incubator-edgent git commit: Edgent-255 improve
StreamScope.setEnabled() behavior
Repository: incubator-edgent
Updated Branches:
refs/heads/master 73daa7757 -> b0d44b587
Edgent-255 improve StreamScope.setEnabled() behavior
Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/b0d44b58
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/b0d44b58
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/b0d44b58
Branch: refs/heads/master
Commit: b0d44b58755cec27a06c2da6569fa8730af58db5
Parents: 73daa77
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Wed Sep 28 12:41:07 2016 -0400
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Wed Sep 28 12:41:07 2016 -0400
----------------------------------------------------------------------
.../java/org/apache/edgent/streamscope/StreamScope.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/b0d44b58/utils/streamscope/src/main/java/org/apache/edgent/streamscope/StreamScope.java
----------------------------------------------------------------------
diff --git a/utils/streamscope/src/main/java/org/apache/edgent/streamscope/StreamScope.java b/utils/streamscope/src/main/java/org/apache/edgent/streamscope/StreamScope.java
index 82f5e2b..55569ce 100644
--- a/utils/streamscope/src/main/java/org/apache/edgent/streamscope/StreamScope.java
+++ b/utils/streamscope/src/main/java/org/apache/edgent/streamscope/StreamScope.java
@@ -370,10 +370,12 @@ public class StreamScope<T> implements Consumer<T> {
* @param isEnabled true to enable, false to disable.
*/
public synchronized void setEnabled(boolean isEnabled) {
- if (!isEnabled)
- buffer.release();
- buffer.allocate();
- this.isEnabled = isEnabled;
+ if (this.isEnabled != isEnabled) {
+ if (!isEnabled)
+ buffer.release();
+ buffer.allocate();
+ this.isEnabled = isEnabled;
+ }
}
/**