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.
Java 11 introduced theString::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, soString::strip()should be used instead.Since OpenRefine now requires Java 11+, we can migrate toString::strip()in most places. Note thatString::trim()apparently removes the\u0000character andString::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.