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 2019/01/23 09:36:30 UTC

[isis] branch v2 updated: ISIS-2033: fixes printed call count of _Probe.println

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

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


The following commit(s) were added to refs/heads/v2 by this push:
     new e8ee473  ISIS-2033: fixes printed call count of _Probe.println
e8ee473 is described below

commit e8ee473ef6cab7c769009c4f1effcffdd2351efd
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Jan 23 10:36:24 2019 +0100

    ISIS-2033: fixes printed call count of _Probe.println
---
 .../src/main/java/org/apache/isis/commons/internal/debug/_Probe.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/core/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java b/core/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
index 4609dd9..5412bb8 100644
--- a/core/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
+++ b/core/commons/src/main/java/org/apache/isis/commons/internal/debug/_Probe.java
@@ -52,7 +52,6 @@ public class _Probe {
     private String emphasisFormat = "__PROBE__ %s";
     
     private final LongAdder counter = new LongAdder();
-    { counter.increment(); }
     
     private _Probe(long maxCalls, MaxCallsReachedAction maxAction) {
         this.maxCalls = maxCalls;
@@ -110,9 +109,9 @@ public class _Probe {
     // -- PRINTING
 
     public void println(int indent, CharSequence chars) {
-        final long counterValue = counter.longValue(); 
-        if(counterValue<=maxCalls) {
+        if(counter.longValue()<maxCalls) {
             counter.increment();
+            final long counterValue = counter.longValue();
             for(int i=0; i<indent; ++i) {
                 out.print(indentLiteral);
             }