public static boolean stringLengthOK(String s){
  if (s == null) {
    throw new IllegalArgumentException("s is null");
  }
  Boolean b=stringLengthOKCached.get(s);
  if (b != null) {
    return b;
  }
  boolean retval=isOKLength(s);
  stringLengthOKCached.put(s,retval);
  return retval;
}

public static boolean stringLengthOK ( String s ) { if ( s == null ) { throw new IllegalArgumentException ( "s is null" ) ; } Boolean b = stringLengthOKCached . get ( s ) ; if ( b != null ) { return b ; } boolean retval = isOKLength ( s ) ; stringLengthOKCached . put ( s , retval ) ; return retval ; }
returns true if the given string is deemed to be reasonable ( i . e . not too long ) based on the - - string - maxlen = n parameter . < p > if randoop generates tests using strings that are too long , this can result in non - compilable tests due to the jvm ' s limit on the length of a string . < p > a string s is too long if , when printed as code in a generated unit test , it may result in a non - compilable test . in order to determine this , we have to consider not the length of s , but the length of the string that would be printed to obtain s , which may be different due to escaped and unicode characters . this method takes this into account .
