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:48:58 UTC

[isis] branch v2 updated: ISIS-2033: also _Probe.println when reaching max calls

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 ac9ea27  ISIS-2033: also _Probe.println when reaching max calls
ac9ea27 is described below

commit ac9ea27ed50a2b7cd2688eae8cb7198228c88b80
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Jan 23 10:48:52 2019 +0100

    ISIS-2033: also _Probe.println when reaching max calls
---
 .../apache/isis/commons/internal/debug/_Probe.java | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 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 5412bb8..7b23075 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
@@ -111,13 +111,11 @@ public class _Probe {
     public void println(int indent, CharSequence chars) {
         if(counter.longValue()<maxCalls) {
             counter.increment();
-            final long counterValue = counter.longValue();
-            for(int i=0; i<indent; ++i) {
-                out.print(indentLiteral);
-            }
-            final String message = "["+label+" "+counterValue+"] "+chars; 
-            out.println(String.format(emphasisFormat, message));
-            return;
+            print_line(indent, chars);
+        }
+        
+        if(counter.longValue()<maxCalls) {
+            return; // skip max-action
         }
 
         switch (maxAction) {
@@ -156,7 +154,16 @@ public class _Probe {
         System.err.println(String.format(format, args));
     }
 
-
+    // -- HELPER
+    
+    private void print_line(int indent, CharSequence chars) {
+        final long counterValue = counter.longValue();
+        for(int i=0; i<indent; ++i) {
+            out.print(indentLiteral);
+        }
+        final String message = "["+label+" "+counterValue+"] "+chars; 
+        out.println(String.format(emphasisFormat, message));
+    }
 
 
 }