public static String toStringWithLimit(Object parameter){
  if (parameter == null) {
    return NULL_STR;
  }
  String value=parameter.toString();
  try {
    if (value.length() > DEFAULT_ARG_STRING_MAX_LENGTH) {
      value=value.substring(0,DEFAULT_ARG_STRING_MAX_LENGTH) + DEFAULT_MAX_STRING_ENDING;
    }
    return value;
  }
 catch (  Throwable e) {
    return UNKNOWN;
  }
}

public static String toStringWithLimit ( Object parameter ) { if ( parameter == null ) { return NULL_STR ; } String value = parameter . toString ( ) ; try { if ( value . length ( ) > DEFAULT_ARG_STRING_MAX_LENGTH ) { value = value . substring ( 0 , DEFAULT_ARG_STRING_MAX_LENGTH ) + DEFAULT_MAX_STRING_ENDING ; } return value ; } catch ( Throwable e ) { return UNKNOWN ; } }
turns a single method parameter into a string . to keep the functionality safe we truncate overly long strings and ignore any exceptions .
