diff --git a/clients/src/main/java/org/apache/kafka/common/utils/Utils.java b/clients/src/main/java/org/apache/kafka/common/utils/Utils.java index 51cb86f5c88b9..f8b8456d5f8d7 100644 --- a/clients/src/main/java/org/apache/kafka/common/utils/Utils.java +++ b/clients/src/main/java/org/apache/kafka/common/utils/Utils.java @@ -901,25 +901,6 @@ public FileVisitResult postVisitDirectory(Path path, IOException exc) throws IOE }); } - /** - * Returns an empty list if the provided list is null, otherwise returns the list itself. - *

- * This method is useful for avoiding {@code NullPointerException} when working with potentially null lists. - * - * @param other the list to check for null - * @return an empty list if the provided list is null, otherwise the original list - */ - public static List safe(List other) { - return other == null ? Collections.emptyList() : other; - } - - /** - * Get the ClassLoader which loaded Kafka. - */ - public static ClassLoader getKafkaClassLoader() { - return Utils.class.getClassLoader(); - } - /** * Get the Context ClassLoader on this thread or, if not present, the ClassLoader that * loaded Kafka. @@ -929,7 +910,7 @@ public static ClassLoader getKafkaClassLoader() { public static ClassLoader getContextOrKafkaClassLoader() { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) - return getKafkaClassLoader(); + return Utils.class.getClassLoader(); else return cl; }