public static String format(String format, Object[] objs) {
    String[] strings = new String[objs.length];
    for (int i = 0; i < objs.length; i++) {
      Object obj = objs[i];
      if (obj == null) {
        strings[i] = "null";

      } else {
        try {
          strings[i] = obj.toString();

        } catch (Exception ex) {
          strings[i] = obj.getClass().getName() + "@" + System.identityHashCode(obj);
        }
      }
    }

    return java.text.MessageFormat.format(format, (Object[]) strings);
  }
Formats a message. Takes special care when invoking the toString() method of objects that might
cause NPEs.
geode-core/src/test/java/org/apache/persistence/admin/Logger.java