test_class.file: clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java
test_class.identifier: UtilsTest
test_case.body: @Test
      public void testFormatAddress() {
          assertEquals("127.0.0.1:8000", formatAddress("127.0.0.1", 8000));
          assertEquals("mydomain.com:8080", formatAddress("mydomain.com", 8080));
          assertEquals("[::1]:1234", formatAddress("::1", 1234));
          assertEquals("[2001:db8:85a3:8d3:1319:8a2e:370:7348]:5678", formatAddress("2001:db8:85a3:8d3:1319:8a2e:370:7348", 5678));
      }
test_case.class_method_signature: UtilsTest.testFormatAddress()
test_case.full_signature: @Test public void testFormatAddress()
test_case.identifier: testFormatAddress
test_case.invocations: assertEquals formatAddress assertEquals formatAddress assertEquals formatAddress assertEquals formatAddress
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFormatAddress()
focal_class.declarator: HOST_PORT_PATTERN = Pattern.compile(".*?\\[?([0-9a-zA-Z\\-%.:]*)\\]?:([0-9]+)")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern HOST_PORT_PATTERN = Pattern.compile(".*?\\[?([0-9a-zA-Z\\-%.:]*)\\]?:([0-9]+)");
focal_class.type: Pattern
focal_class.var_name: HOST_PORT_PATTERN
focal_class.declarator: NL = System.getProperty("line.separator")
focal_class.modifier: public static final
focal_class.original_string: public static final String NL = System.getProperty("line.separator");
focal_class.type: String
focal_class.var_name: NL
focal_class.declarator: log = LoggerFactory.getLogger(Utils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(Utils.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: clients/src/main/java/org/apache/kafka/common/utils/Utils.java
focal_class.identifier: Utils
focal_class.class_method_signature: Utils.sorted(Collection<T> collection)
focal_class.full_signature: public static List<T> sorted(Collection<T> collection)
focal_class.identifier: sorted
focal_class.modifiers: public static
focal_class.parameters: (Collection<T> collection)
focal_class.return: List<T>
focal_class.signature: List<T> sorted(Collection<T> collection)
focal_class.class_method_signature: Utils.utf8(byte[] bytes)
focal_class.full_signature: public static String utf8(byte[] bytes)
focal_class.identifier: utf8
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes)
focal_class.return: String
focal_class.signature: String utf8(byte[] bytes)
focal_class.class_method_signature: Utils.utf8(String string)
focal_class.full_signature: public static byte[] utf8(String string)
focal_class.identifier: utf8
focal_class.modifiers: public static
focal_class.parameters: (String string)
focal_class.return: byte[]
focal_class.signature: byte[] utf8(String string)
focal_class.class_method_signature: Utils.readUnsignedInt(ByteBuffer buffer)
focal_class.full_signature: public static long readUnsignedInt(ByteBuffer buffer)
focal_class.identifier: readUnsignedInt
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer)
focal_class.return: long
focal_class.signature: long readUnsignedInt(ByteBuffer buffer)
focal_class.class_method_signature: Utils.readUnsignedInt(ByteBuffer buffer, int index)
focal_class.full_signature: public static long readUnsignedInt(ByteBuffer buffer, int index)
focal_class.identifier: readUnsignedInt
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, int index)
focal_class.return: long
focal_class.signature: long readUnsignedInt(ByteBuffer buffer, int index)
focal_class.class_method_signature: Utils.readUnsignedIntLE(InputStream in)
focal_class.full_signature: public static int readUnsignedIntLE(InputStream in)
focal_class.identifier: readUnsignedIntLE
focal_class.modifiers: public static
focal_class.parameters: (InputStream in)
focal_class.return: int
focal_class.signature: int readUnsignedIntLE(InputStream in)
focal_class.class_method_signature: Utils.toArrayLE(int val)
focal_class.full_signature: public static byte[] toArrayLE(int val)
focal_class.identifier: toArrayLE
focal_class.modifiers: public static
focal_class.parameters: (int val)
focal_class.return: byte[]
focal_class.signature: byte[] toArrayLE(int val)
focal_class.class_method_signature: Utils.readUnsignedIntLE(byte[] buffer, int offset)
focal_class.full_signature: public static int readUnsignedIntLE(byte[] buffer, int offset)
focal_class.identifier: readUnsignedIntLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] buffer, int offset)
focal_class.return: int
focal_class.signature: int readUnsignedIntLE(byte[] buffer, int offset)
focal_class.class_method_signature: Utils.writeUnsignedInt(ByteBuffer buffer, long value)
focal_class.full_signature: public static void writeUnsignedInt(ByteBuffer buffer, long value)
focal_class.identifier: writeUnsignedInt
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, long value)
focal_class.return: void
focal_class.signature: void writeUnsignedInt(ByteBuffer buffer, long value)
focal_class.class_method_signature: Utils.writeUnsignedInt(ByteBuffer buffer, int index, long value)
focal_class.full_signature: public static void writeUnsignedInt(ByteBuffer buffer, int index, long value)
focal_class.identifier: writeUnsignedInt
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, int index, long value)
focal_class.return: void
focal_class.signature: void writeUnsignedInt(ByteBuffer buffer, int index, long value)
focal_class.class_method_signature: Utils.writeUnsignedIntLE(OutputStream out, int value)
focal_class.full_signature: public static void writeUnsignedIntLE(OutputStream out, int value)
focal_class.identifier: writeUnsignedIntLE
focal_class.modifiers: public static
focal_class.parameters: (OutputStream out, int value)
focal_class.return: void
focal_class.signature: void writeUnsignedIntLE(OutputStream out, int value)
focal_class.class_method_signature: Utils.writeUnsignedIntLE(byte[] buffer, int offset, int value)
focal_class.full_signature: public static void writeUnsignedIntLE(byte[] buffer, int offset, int value)
focal_class.identifier: writeUnsignedIntLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] buffer, int offset, int value)
focal_class.return: void
focal_class.signature: void writeUnsignedIntLE(byte[] buffer, int offset, int value)
focal_class.class_method_signature: Utils.abs(int n)
focal_class.full_signature: public static int abs(int n)
focal_class.identifier: abs
focal_class.modifiers: public static
focal_class.parameters: (int n)
focal_class.return: int
focal_class.signature: int abs(int n)
focal_class.class_method_signature: Utils.min(long first, long ... rest)
focal_class.full_signature: public static long min(long first, long ... rest)
focal_class.identifier: min
focal_class.modifiers: public static
focal_class.parameters: (long first, long ... rest)
focal_class.return: long
focal_class.signature: long min(long first, long ... rest)
focal_class.class_method_signature: Utils.utf8Length(CharSequence s)
focal_class.full_signature: public static int utf8Length(CharSequence s)
focal_class.identifier: utf8Length
focal_class.modifiers: public static
focal_class.parameters: (CharSequence s)
focal_class.return: int
focal_class.signature: int utf8Length(CharSequence s)
focal_class.class_method_signature: Utils.toArray(ByteBuffer buffer)
focal_class.full_signature: public static byte[] toArray(ByteBuffer buffer)
focal_class.identifier: toArray
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer)
focal_class.return: byte[]
focal_class.signature: byte[] toArray(ByteBuffer buffer)
focal_class.class_method_signature: Utils.toArray(ByteBuffer buffer, int offset, int size)
focal_class.full_signature: public static byte[] toArray(ByteBuffer buffer, int offset, int size)
focal_class.identifier: toArray
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, int offset, int size)
focal_class.return: byte[]
focal_class.signature: byte[] toArray(ByteBuffer buffer, int offset, int size)
focal_class.class_method_signature: Utils.notNull(T t)
focal_class.full_signature: public static T notNull(T t)
focal_class.identifier: notNull
focal_class.modifiers: public static
focal_class.parameters: (T t)
focal_class.return: T
focal_class.signature: T notNull(T t)
focal_class.class_method_signature: Utils.sleep(long ms)
focal_class.full_signature: public static void sleep(long ms)
focal_class.identifier: sleep
focal_class.modifiers: public static
focal_class.parameters: (long ms)
focal_class.return: void
focal_class.signature: void sleep(long ms)
focal_class.class_method_signature: Utils.newInstance(Class<T> c)
focal_class.full_signature: public static T newInstance(Class<T> c)
focal_class.identifier: newInstance
focal_class.modifiers: public static
focal_class.parameters: (Class<T> c)
focal_class.return: T
focal_class.signature: T newInstance(Class<T> c)
focal_class.class_method_signature: Utils.newInstance(String klass, Class<T> base)
focal_class.full_signature: public static T newInstance(String klass, Class<T> base)
focal_class.identifier: newInstance
focal_class.modifiers: public static
focal_class.parameters: (String klass, Class<T> base)
focal_class.return: T
focal_class.signature: T newInstance(String klass, Class<T> base)
focal_class.class_method_signature: Utils.murmur2(final byte[] data)
focal_class.full_signature: public static int murmur2(final byte[] data)
focal_class.identifier: murmur2
focal_class.modifiers: public static
focal_class.parameters: (final byte[] data)
focal_class.return: int
focal_class.signature: int murmur2(final byte[] data)
focal_class.class_method_signature: Utils.getHost(String address)
focal_class.full_signature: public static String getHost(String address)
focal_class.identifier: getHost
focal_class.modifiers: public static
focal_class.parameters: (String address)
focal_class.return: String
focal_class.signature: String getHost(String address)
focal_class.class_method_signature: Utils.getPort(String address)
focal_class.full_signature: public static Integer getPort(String address)
focal_class.identifier: getPort
focal_class.modifiers: public static
focal_class.parameters: (String address)
focal_class.return: Integer
focal_class.signature: Integer getPort(String address)
focal_class.class_method_signature: Utils.formatAddress(String host, Integer port)
focal_class.full_signature: public static String formatAddress(String host, Integer port)
focal_class.identifier: formatAddress
focal_class.modifiers: public static
focal_class.parameters: (String host, Integer port)
focal_class.return: String
focal_class.signature: String formatAddress(String host, Integer port)
focal_class.class_method_signature: Utils.join(T[] strs, String seperator)
focal_class.full_signature: public static String join(T[] strs, String seperator)
focal_class.identifier: join
focal_class.modifiers: public static
focal_class.parameters: (T[] strs, String seperator)
focal_class.return: String
focal_class.signature: String join(T[] strs, String seperator)
focal_class.class_method_signature: Utils.join(Collection<T> list, String seperator)
focal_class.full_signature: public static String join(Collection<T> list, String seperator)
focal_class.identifier: join
focal_class.modifiers: public static
focal_class.parameters: (Collection<T> list, String seperator)
focal_class.return: String
focal_class.signature: String join(Collection<T> list, String seperator)
focal_class.class_method_signature: Utils.loadProps(String filename)
focal_class.full_signature: public static Properties loadProps(String filename)
focal_class.identifier: loadProps
focal_class.modifiers: public static
focal_class.parameters: (String filename)
focal_class.return: Properties
focal_class.signature: Properties loadProps(String filename)
focal_class.class_method_signature: Utils.propsToStringMap(Properties props)
focal_class.full_signature: public static Map<String, String> propsToStringMap(Properties props)
focal_class.identifier: propsToStringMap
focal_class.modifiers: public static
focal_class.parameters: (Properties props)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> propsToStringMap(Properties props)
focal_class.class_method_signature: Utils.stackTrace(Throwable e)
focal_class.full_signature: public static String stackTrace(Throwable e)
focal_class.identifier: stackTrace
focal_class.modifiers: public static
focal_class.parameters: (Throwable e)
focal_class.return: String
focal_class.signature: String stackTrace(Throwable e)
focal_class.class_method_signature: Utils.newThread(String name, Runnable runnable, boolean daemon)
focal_class.full_signature: public static Thread newThread(String name, Runnable runnable, boolean daemon)
focal_class.identifier: newThread
focal_class.modifiers: public static
focal_class.parameters: (String name, Runnable runnable, boolean daemon)
focal_class.return: Thread
focal_class.signature: Thread newThread(String name, Runnable runnable, boolean daemon)
focal_class.class_method_signature: Utils.daemonThread(String name, Runnable runnable)
focal_class.full_signature: public static Thread daemonThread(String name, Runnable runnable)
focal_class.identifier: daemonThread
focal_class.modifiers: public static
focal_class.parameters: (String name, Runnable runnable)
focal_class.return: Thread
focal_class.signature: Thread daemonThread(String name, Runnable runnable)
focal_class.class_method_signature: Utils.croak(String message)
focal_class.full_signature: public static void croak(String message)
focal_class.identifier: croak
focal_class.modifiers: public static
focal_class.parameters: (String message)
focal_class.return: void
focal_class.signature: void croak(String message)
focal_class.class_method_signature: Utils.readBytes(ByteBuffer buffer, int offset, int length)
focal_class.full_signature: public static byte[] readBytes(ByteBuffer buffer, int offset, int length)
focal_class.identifier: readBytes
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer, int offset, int length)
focal_class.return: byte[]
focal_class.signature: byte[] readBytes(ByteBuffer buffer, int offset, int length)
focal_class.class_method_signature: Utils.readBytes(ByteBuffer buffer)
focal_class.full_signature: public static byte[] readBytes(ByteBuffer buffer)
focal_class.identifier: readBytes
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer buffer)
focal_class.return: byte[]
focal_class.signature: byte[] readBytes(ByteBuffer buffer)
focal_class.class_method_signature: Utils.readFileAsString(String path, Charset charset)
focal_class.full_signature: public static String readFileAsString(String path, Charset charset)
focal_class.identifier: readFileAsString
focal_class.modifiers: public static
focal_class.parameters: (String path, Charset charset)
focal_class.return: String
focal_class.signature: String readFileAsString(String path, Charset charset)
focal_class.class_method_signature: Utils.readFileAsString(String path)
focal_class.full_signature: public static String readFileAsString(String path)
focal_class.identifier: readFileAsString
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: String
focal_class.signature: String readFileAsString(String path)
focal_class.class_method_signature: Utils.ensureCapacity(ByteBuffer existingBuffer, int newLength)
focal_class.full_signature: public static ByteBuffer ensureCapacity(ByteBuffer existingBuffer, int newLength)
focal_class.identifier: ensureCapacity
focal_class.modifiers: public static
focal_class.parameters: (ByteBuffer existingBuffer, int newLength)
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer ensureCapacity(ByteBuffer existingBuffer, int newLength)
focal_class.class_method_signature: Utils.mkSet(T... elems)
focal_class.full_signature: @SafeVarargs public static Set<T> mkSet(T... elems)
focal_class.identifier: mkSet
focal_class.modifiers: @SafeVarargs public static
focal_class.parameters: (T... elems)
focal_class.return: Set<T>
focal_class.signature: Set<T> mkSet(T... elems)
focal_class.class_method_signature: Utils.mkList(T... elems)
focal_class.full_signature: @SafeVarargs public static List<T> mkList(T... elems)
focal_class.identifier: mkList
focal_class.modifiers: @SafeVarargs public static
focal_class.parameters: (T... elems)
focal_class.return: List<T>
focal_class.signature: List<T> mkList(T... elems)
focal_class.class_method_signature: Utils.mkString(Collection<T> coll, String separator)
focal_class.full_signature: public static CharSequence mkString(Collection<T> coll, String separator)
focal_class.identifier: mkString
focal_class.modifiers: public static
focal_class.parameters: (Collection<T> coll, String separator)
focal_class.return: CharSequence
focal_class.signature: CharSequence mkString(Collection<T> coll, String separator)
focal_class.class_method_signature: Utils.delete(File file)
focal_class.full_signature: public static void delete(File file)
focal_class.identifier: delete
focal_class.modifiers: public static
focal_class.parameters: (File file)
focal_class.return: void
focal_class.signature: void delete(File file)
focal_class.class_method_signature: Utils.safe(List<T> other)
focal_class.full_signature: public static List<T> safe(List<T> other)
focal_class.identifier: safe
focal_class.modifiers: public static
focal_class.parameters: (List<T> other)
focal_class.return: List<T>
focal_class.signature: List<T> safe(List<T> other)
focal_class.class_method_signature: Utils.getKafkaClassLoader()
focal_class.full_signature: public static ClassLoader getKafkaClassLoader()
focal_class.identifier: getKafkaClassLoader
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getKafkaClassLoader()
focal_class.class_method_signature: Utils.getContextOrKafkaClassLoader()
focal_class.full_signature: public static ClassLoader getContextOrKafkaClassLoader()
focal_class.identifier: getContextOrKafkaClassLoader
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getContextOrKafkaClassLoader()
focal_class.class_method_signature: Utils.atomicMoveWithFallback(Path source, Path target)
focal_class.full_signature: public static void atomicMoveWithFallback(Path source, Path target)
focal_class.identifier: atomicMoveWithFallback
focal_class.modifiers: public static
focal_class.parameters: (Path source, Path target)
focal_class.return: void
focal_class.signature: void atomicMoveWithFallback(Path source, Path target)
focal_class.class_method_signature: Utils.closeAll(Closeable... closeables)
focal_class.full_signature: public static void closeAll(Closeable... closeables)
focal_class.identifier: closeAll
focal_class.modifiers: public static
focal_class.parameters: (Closeable... closeables)
focal_class.return: void
focal_class.signature: void closeAll(Closeable... closeables)
focal_method.body: public static String formatAddress(String host, Integer port) {
          return host.contains(":")
                  ? "[" + host + "]:" + port // IPv6
                  : host + ":" + port;
      }
focal_method.class_method_signature: Utils.formatAddress(String host, Integer port)
focal_method.full_signature: public static String formatAddress(String host, Integer port)
focal_method.identifier: formatAddress
focal_method.invocations: contains
focal_method.modifiers: public static
focal_method.parameters: (String host, Integer port)
focal_method.return: String
focal_method.signature: String formatAddress(String host, Integer port)