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

java.util.regex.Pattern null pointer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 6, 8-pool
    • core-libs

      FULL PRODUCT VERSION :
      java version " 1.6.0_38 "
      Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
      Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Versione 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      public static void main(String[] args) {
      Pattern replace = Pattern.compile( " \\s+ " );
      replace.matcher(null);
      }

      throw:

      Exception in thread " main " java.lang.NullPointerException
      at java.util.regex.Matcher.getTextLength(Matcher.java:1234)
      at java.util.regex.Matcher.reset(Matcher.java:308)
      at java.util.regex.Matcher.<init>(Matcher.java:228)
      at java.util.regex.Pattern.matcher(Pattern.java:1088)
      at test.main(test.java:13)


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should throw a specific exception?

      REPRODUCIBILITY :
      This bug can be reproduced always.

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

              Created:
              Updated:
              Resolved: