API Review Request for RT-17438

Richard Bair richard.bair at oracle.com
Fri Apr 13 13:05:02 PDT 2012


> Some random thoughts:
> - White space typically includes newlines, and the isWhitespace method
> returns true only for tabs and spaces. The documentations makes it clear
> what the method does, but it wouldn't be a stretch for a developer to
> assume that white space includes newlines. ... especially developers that
> do a lot of work with HTML.

Good point. The Character.isWhiteSpace says:

Determines if the specified character is white space according to Java. A character is a Java whitespace character if and only if it satisfies one of the following criteria:
	• It is a Unicode space character (SPACE_SEPARATOR, LINE_SEPARATOR, or PARAGRAPH_SEPARATOR) but is not also a non-breaking space ('\u00A0', '\u2007', '\u202F').
	• It is '\t', U+0009 HORIZONTAL TABULATION.
	• It is '\n', U+000A LINE FEED.
	• It is '\u000B', U+000B VERTICAL TABULATION.
	• It is '\f', U+000C FORM FEED.
	• It is '\r', U+000D CARRIAGE RETURN.
	• It is '\u001C', U+001C FILE SEPARATOR.
	• It is '\u001D', U+001D GROUP SEPARATOR.
	• It is '\u001E', U+001E RECORD SEPARATOR.
	• It is '\u001F', U+001F UNIT SEPARATOR.

Seems like we should have whitespace mean the same thing? Or is this the difference between detecting which physical key was pressed vs. which type of data was entered?



More information about the openjfx-dev mailing list