JDK-8341522 : Character.isWhitespace(Character.PARAGRAPH_SEPARATOR)) always returns false
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8,11,17,21,24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2024-10-03
  • Updated: 2024-10-04
Description
ADDITIONAL SYSTEM INFORMATION :
Multiple Linux OS.  Multiple Java implementations, Multiple Java versions from 8 to 21.

A DESCRIPTION OF THE PROBLEM :
Documentation for isWhitespace() indicates that Character.PARAGRAPH_SEPARATOR is considered whitespace.  However, on all systems tested the line

System.out.println("PARAGRAPH_SEPARATOR is white space? " + Character.isWhitespace(Character.PARAGRAPH_SEPARATOR));

Always prints "false"

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute System.out.println("PARAGRAPH_SEPARATOR is white space? " + Character.isWhitespace(Character.PARAGRAPH_SEPARATOR));

ACTUAL -
false

---------- BEGIN SOURCE ----------
public class Test {
    public static void main(String[] args) {
        System.out.println("PARAGRAPH_SEPARATOR is white space? " + Character.isWhitespace(Character.PARAGRAPH_SEPARATOR));
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
creating a static isWhitespace that adds the test for PARAGRAPH_SEPARATOR after call to Character.isWhitespace.

FREQUENCY : always



Comments
Observation on Windows 11 -------------------------------- JDK 1.8.0_421 : Failed (Character.isWhitespace(Character.PARAGRAPH_SEPARATOR) returns false) JDK 11.0.24 : Failed JDK 17.0.12 : Failed JDK 21.0.4 : Failed JDK 23 : Failed JDK 24ea : Failed
04-10-2024