Skip to content

Fix spaces added inside randomString method#2988

Open
DariaBod wants to merge 3 commits into
developfrom
fb_fixSpacesInDataGenerator
Open

Fix spaces added inside randomString method#2988
DariaBod wants to merge 3 commits into
developfrom
fb_fixSpacesInDataGenerator

Conversation

@DariaBod
Copy link
Copy Markdown
Contributor

@DariaBod DariaBod commented May 8, 2026

Rationale

Just changed randomString method instead of insertSpaces.

Note: check build before merge.

Related Pull Requests

Changes

@DariaBod DariaBod self-assigned this May 12, 2026
Comment thread src/org/labkey/test/util/TestDataGenerator.java Outdated
Comment thread src/org/labkey/test/util/TestDataGenerator.java Outdated
Copy link
Copy Markdown
Member

@labkey-tchad labkey-tchad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few suggestions


/** 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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

DariaBod and others added 2 commits May 12, 2026 15:46
Co-authored-by: Trey Chadick <tchad@labkey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants