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

java.util.regex.Pattern.matcher(null) is to be specified as NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • core-libs

      A DESCRIPTION OF THE PROBLEM :
      The API document is not mentioning the case that java.utl.regex.Pattern.matcher(input) gets the argument input = null, and the description can be read that the method 'matcher' never raises exceptions. However jre provided by Oracle raises NullPointerException for the case.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
        To be added the 'Throws' paragraph to the 'matcher's description, and be described about the case if input is null.
      ACTUAL -
      Nothing about the exception is written.

      URL OF FAULTY DOCUMENTATION :
      http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#matcher(java.lang.CharSequence)

            sherman Xueming Shen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: