public String format(String... reasons) {
    /* Not all messages are parametrized even those that should have been, e.g {@link #INVALID_TABLE}.
     INVALID_TABLE is usually used with {@link #getMsg(String)}.
     This method can also be used with INVALID_TABLE and the like and will match getMsg(String) behavior.

     Another example: {@link #INVALID_PARTITION}.  Ideally you want the message to have 2 parameters one for
     partition name one for table name.  Since this is already defined w/o any parameters, one can still call
     {@code INVALID_PARTITION.format("<partName> <table Name>"}.  This way the message text will be slightly
     different but at least the errorCode will match.  Note this, should not be abused by adding anything other
     than what should have been parameter names to keep msg text standardized.
     */
    if(reasons == null || reasons.length == 0) {
      return getMsg();
    }
    if(format != null) {
      return format.format(reasons);
    }
    if(reasons.length > 1) {
      StringBuilder sb = new StringBuilder();
      for(String re : reasons) {
        if(re != null) {
          if(sb.length() > 0) {
            sb.append(" ");
          }
          sb.append(re);
        }
      }
      return getMsg(sb.toString());
    }
    return getMsg(reasons[0]);
  }
If the message is parametrized, this will fill the parameters with supplied
{@code reasons}, otherwise {@code reasons} are appended at the end of the
message.
common/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java