Fix spaces added inside randomString method#2988
Conversation
|
|
||
| /** After this many consecutive non-space characters, {@link #randomString} forces the next char to ' ' | ||
| * (provided ' ' is in the effective charset). */ | ||
| private static final int FORCE_SPACE_AFTER = 8; |
There was a problem hiding this comment.
8 feels a little short, I'd go with something like 20.
The problems we're seeing are with 50+ character long strings without a break.
There was a problem hiding this comment.
A limit of 20 is ok, but a bit on the high end. Looking at the list of "real name of things" data the average number of character in a name with spaces is closer to 12 to 15.
For names without spaces, and using underscores, the lengths are in the 20+ range.
|
|
||
| /** After this many consecutive non-space characters, {@link #randomString} forces the next char to ' ' | ||
| * (provided ' ' is in the effective charset). */ | ||
| private static final int FORCE_SPACE_AFTER = 8; |
There was a problem hiding this comment.
A limit of 20 is ok, but a bit on the high end. Looking at the list of "real name of things" data the average number of character in a name with spaces is closer to 12 to 15.
For names without spaces, and using underscores, the lengths are in the 20+ range.
Co-authored-by: Trey Chadick <tchad@labkey.com>
Rationale
Just changed randomString method instead of insertSpaces.
Note: check build before merge.
Related Pull Requests
Changes