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

ExceptionInInitializerError is caught when the pattern has precomposed character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 6
    • core-libs
    • b119
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_07"
      Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
      Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      ExceptionInInitializerError is caught when the pattern has precomposed characters in CANON_EQ mode.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the program.

      ACTUAL -
      java.lang.ExceptionInInitializerError
      Caused by: java.util.regex.PatternSyntaxException: Unclosed group near index 27
      (?:e?e|?e|ee?(?:e?n|?n|en?)
                                 ^
      at java.util.regex.Pattern.error(Unknown Source)
      at java.util.regex.Pattern.accept(Unknown Source)
      at java.util.regex.Pattern.group0(Unknown Source)
      at java.util.regex.Pattern.sequence(Unknown Source)
      at java.util.regex.Pattern.expr(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at java.util.regex.Pattern.<init>(Unknown Source)
      at java.util.regex.Pattern.compile(Unknown Source)
      at sample.RegexTest.<clinit>(RegexTest.java:6)

      Exception in thread "main"

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package sample;

      import java.util.regex.*;

      public class RegexTest {
      static final Pattern pt = Pattern.compile("één", Pattern.CANON_EQ);

      public static void main(String[] args) {
      System.out.println(pt.matcher("één").matches());
      }
      }

      ---------- END SOURCE ----------

            sherman Xueming Shen
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: