Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8341522

Character.isWhitespace(Character.PARAGRAPH_SEPARATOR)) always returns false

XMLWordPrintable

    • generic
    • generic

      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


            jlu Justin Lu
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: