From cf41d8ece6b6354937cb1993861ef4c61f4d268b Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Sat, 4 Jul 2015 00:49:44 -0600 Subject: [PATCH] polish --- .../java/org/springframework/cloud/sleuth/MilliSpan.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/MilliSpan.java b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/MilliSpan.java index 450068fcc..858060afb 100644 --- a/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/MilliSpan.java +++ b/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/MilliSpan.java @@ -30,19 +30,22 @@ public class MilliSpan implements Span { @Override public synchronized void stop() { if (end == 0) { - if (begin == 0) + if (begin == 0) { throw new IllegalStateException("Span for " + name + " has not been started"); + } end = System.currentTimeMillis(); } } @Override public synchronized long getAccumulatedMillis() { - if (begin == 0) + if (begin == 0) { return 0; - if (end > 0) + } + if (end > 0) { return end - begin; + } return System.currentTimeMillis() - begin; }