static String getTrimmedToString(@NullableDecl MessageLite messageLite) {
    String subjectString = String.valueOf(messageLite);
    String trimmedSubjectString = subjectString.trim();
    if (trimmedSubjectString.startsWith("# ")) {
      String objectToString =
          String.format(
              "# %s@%s",
              messageLite.getClass().getName(), Integer.toHexString(messageLite.hashCode()));
      if (trimmedSubjectString.startsWith(objectToString)) {
        subjectString = trimmedSubjectString.replaceFirst(Pattern.quote(objectToString), "").trim();
      }
    }

    return subjectString.isEmpty() ? "[empty proto]" : subjectString;
  }
static String getTrimmedToString ( @ NullableDecl MessageLite messageLite ) { String subjectString = String . valueOf ( messageLite ) ; String trimmedSubjectString = subjectString . trim ( ) ; if ( trimmedSubjectString . startsWith ( "# " ) ) { String objectToString = String . format ( "# %s@%s" , messageLite . getClass ( ) . getName ( ) , Integer . toHexString ( messageLite . hashCode ( ) ) ) ; if ( trimmedSubjectString . startsWith ( objectToString ) ) { subjectString = trimmedSubjectString . replaceFirst ( Pattern . quote ( objectToString ) , "" ) . trim ( ) ; } } return subjectString . isEmpty ( ) ? "[empty proto]" : subjectString ; }
TODO(user): Maybe get a way to do this upstream.