Address trivial eclipse warnings
[yangtools.git] / common / util / src / main / java / org / opendaylight / yangtools / util / DurationStatisticsTracker.java
index 810111d86bfa20d71242271bdb6097c07d0e83c0..c376afc2ade0f22b03884cc0f72ded2e6e67daa6 100644 (file)
@@ -182,11 +182,10 @@ public abstract class DurationStatisticsTracker {
     }
 
     private static String formatDuration(final DurationWithTime current) {
-        if (current != null) {
-            return formatDuration(current.getDuration(), current.getTimeMillis());
-        } else {
+        if (current == null) {
             return formatDuration(0, null);
         }
+        return formatDuration(current.getDuration(), current.getTimeMillis());
     }
 
     private static TimeUnit chooseUnit(final long nanos) {
@@ -205,23 +204,23 @@ public abstract class DurationStatisticsTracker {
 
     private static String abbreviate(final TimeUnit unit) {
         switch (unit) {
-        case NANOSECONDS:
-            return "ns";
-        case MICROSECONDS:
-            return "\u03bcs"; // μs
-        case MILLISECONDS:
-            return "ms";
-        case SECONDS:
-            return "s";
-        case MINUTES:
-            return "m";
-        case HOURS:
-            return "h";
-        case DAYS:
-            return "d";
-        default:
-            LOG.warn("Unhandled time unit {}", unit);
-            return "";
+            case NANOSECONDS:
+                return "ns";
+            case MICROSECONDS:
+                return "\u03bcs"; // μs
+            case MILLISECONDS:
+                return "ms";
+            case SECONDS:
+                return "s";
+            case MINUTES:
+                return "m";
+            case HOURS:
+                return "h";
+            case DAYS:
+                return "d";
+            default:
+                LOG.warn("Unhandled time unit {}", unit);
+                return "";
         }
     }
 }