cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Fixing another 3.1.x build failure
Date Mon, 27 Feb 2017 12:47:23 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes c505778b1 -> a535fb925


Fixing another 3.1.x build failure


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a535fb92
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a535fb92
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a535fb92

Branch: refs/heads/3.1.x-fixes
Commit: a535fb9255b26d49c55e4cd015bc6fc6e967145d
Parents: c505778
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Feb 27 12:46:55 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Feb 27 12:46:55 2017 +0000

----------------------------------------------------------------------
 .../tracing/htrace/ext/LoggingSpanReceiver.java | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a535fb92/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/ext/LoggingSpanReceiver.java
----------------------------------------------------------------------
diff --git a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/ext/LoggingSpanReceiver.java
b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/ext/LoggingSpanReceiver.java
index 332b385..5d5404d 100644
--- a/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/ext/LoggingSpanReceiver.java
+++ b/integration/tracing/tracing-htrace/src/main/java/org/apache/cxf/tracing/htrace/ext/LoggingSpanReceiver.java
@@ -20,10 +20,7 @@
 package org.apache.cxf.tracing.htrace.ext;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.Map;
-import java.util.function.Function;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -106,7 +103,7 @@ public class LoggingSpanReceiver extends SpanReceiver {
         
         append(sb, "parents", span.getParents());
         append(sb, "kvs", span.getKVAnnotations());
-        append(sb, "timelines", span.getTimelineAnnotations(), t -> "[" + toString(t)
+ "]");
+        append(sb, "timelines", span.getTimelineAnnotations().toArray(), true);
         
         return sb.toString();
     }
@@ -120,13 +117,22 @@ public class LoggingSpanReceiver extends SpanReceiver {
 
         append(sb, key, inner.insert(0, "[").append("]").toString());
     }
-    
-    private<T> void append(StringBuilder sb, String key, Collection<T> values,
Function<T, String> stringifyer) {
-        append(sb, key, Arrays.toString(values.stream().map(stringifyer::apply).toArray(String[]::new)));
-    }
-    
+
     private<T> void append(StringBuilder sb, String key, T[] values) {
-        append(sb, key, Arrays.toString(Arrays.stream(values).map(T::toString).toArray(String[]::new)));
+        append(sb, key, values, false);
+    }
+    private<T> void append(StringBuilder sb, String key, T[] values, boolean useBrackets)
{
+        final StringBuilder inner = new StringBuilder();
+        
+        for (T value : values) {
+            String str = value.toString();
+            if (useBrackets) {
+                str = "[" + str + "]";
+            }
+            append(inner, quote(key), str, true);
+        }
+
+        append(sb, key, inner.insert(0, "[").append("]").toString());
     }
     
     private void append(StringBuilder sb, String key, long value) {


Mime
View raw message