JDK-8200372 : String::trim JavaDoc should clarify meaning of space
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-03-28
  • Updated: 2018-05-11
  • Resolved: 2018-05-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b13Fixed
Related Reports
CSR :  
Relates :  
Description
The current JavaDoc for String::trim does not make it clear which definition of "space" is being used in the code.  With additional trimming methods coming in the near future, that use a different definition of space, it makes sense to clarify String::trim's definition so that the distinction in what is a space is clear.

String::trim uses the definition of space as any codepoint that is less than or equal to the space character codepoint (\u0040.)

Newer trimming methods will use the definition of (white) space as any codepoint that returns true when passed to the Character::isWhitespace predicate.