@Test public void testAddCustomAnnotationsWithNullAnnotations() { when(con.getCustomTracingAnnotations()).thenReturn(null); String logLine = LogUtil.addCustomAnnotations("log line", con); assertEquals(logLine, "log line"); }
public static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con) { if (con == null || con.getCustomTracingAnnotations() == null || con.getCustomTracingAnnotations().isEmpty()) { return logLine; } else { return customAnnotationsToString(con) + ' ' + logLine; } }
LogUtil { public static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con) { if (con == null || con.getCustomTracingAnnotations() == null || con.getCustomTracingAnnotations().isEmpty()) { return logLine; } else { return customAnnotationsToString(con) + ' ' + logLine; } } }
LogUtil { public static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con) { if (con == null || con.getCustomTracingAnnotations() == null || con.getCustomTracingAnnotations().isEmpty()) { return logLine; } else { return customAnnotationsToString(con) + ' ' + logLine; } } private  LogUtil(); }
LogUtil { public static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con) { if (con == null || con.getCustomTracingAnnotations() == null || con.getCustomTracingAnnotations().isEmpty()) { return logLine; } else { return customAnnotationsToString(con) + ' ' + logLine; } } private  LogUtil(); static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con); static String addCustomAnnotations(@Nullable String logLine, @Nullable byte[] annotations); static String customAnnotationsToString(@Nullable PhoenixConnection con); static String getCallerStackTrace(); }
LogUtil { public static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con) { if (con == null || con.getCustomTracingAnnotations() == null || con.getCustomTracingAnnotations().isEmpty()) { return logLine; } else { return customAnnotationsToString(con) + ' ' + logLine; } } private  LogUtil(); static String addCustomAnnotations(@Nullable String logLine, @Nullable PhoenixConnection con); static String addCustomAnnotations(@Nullable String logLine, @Nullable byte[] annotations); static String customAnnotationsToString(@Nullable PhoenixConnection con); static String getCallerStackTrace();  }