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

Matcher.groupCont() returns unexpected values.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta2
    • sparc
    • solaris_8
    • Verified

      Matcher.groupCont() returns unexpected value for few tests.

      Following is the result of the testcase, where "Result" and "Expected" means matcher.groupCount() .

      Pattern: (?(?!a)a|b)
      Input: a
      Result: 0
      Expected: 1

      Pattern: (?(?!a)b|a)
      Input: a
      Result: 0
      Expected: 1

      Pattern: (?(?=a)b|a)
      Input: a
      Result: 0
      Expected: 1

      Pattern: (?(?=a)a|b)
      Input: a
      Result: 0
      Expected: 1

      Pattern: (?>a+)b
      Input: aaab
      Result: 0
      Expected: 1

      Pattern: ((?>a+)b)
      Input: aaab
      Result: 1
      Expected: 2

      Pattern: (?>(a+))b
      Input: aaab
      Result: 1
      Expected: 2

      Pattern: ((?>[^()]+)|\([^()]*\))+
      Input: ((abc(ade)ufh()()x
      Result: 1
      Expected: 2

      Pattern: round\(((?>[^()]+))\)
      Input: _I(round(xs * sz),1)
      Result: 1
      Expected: 2
        
      testcase location:-
      /net/sqesvr/export/xlt/libs/merlin/dev/testbase/src/libs_api_tests/common/java_util/Regex/Matcher/RegexTest.java

            mmcclosksunw Michael Mccloskey (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: