Skip to content

Migrate calls to String::trim() to Guava's whitespace trimming #5105

Description

@wetneb

Java 11 introduced the String::strip() method, which strips whitespace around a string, including newer Unicode whitespace characters.
We currently use the String::trim() method in a number of places. In many of those places, the string being trimmed can legitimately contain any Unicode character, so String::strip() should be used instead.

Since OpenRefine now requires Java 11+, we can migrate to String::strip() in most places. Note that String::trim() apparently removes the \u0000 character and String::strip() does not, but I am not sure if that is relevant anywhere for us.

We should rather migrate to Guava's whitespace trimming, see @ostephens's post below.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Good First IssueIndicates issues suitable for newcomers to design or coding, providing a gentle introduction.Type: Feature RequestIdentifies requests for new features or enhancements. These involve proposing new improvements.java version compatibilityMaking sure OpenRefine runs on as many Java versions as possible

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions