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

Linebreak matcher is not equivalent to the pattern as stated in javadoc

    Details

    • Subcomponent:
    • Resolved In Build:
      b161
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        A DESCRIPTION OF THE PROBLEM :
        The documentation for Linebreak Matcher \R states that it is equivalent to a specific pattern. However if we substitute that equivalent pattern into a regex, it can give different results.
        See the following Stack Overflow question and answer for details--
        http://stackoverflow.com/q/42474596/7098259

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        ...is equivalent to (?<!\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029])
        ACTUAL -
        ...is equivalent to \u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]

        URL OF FAULTY DOCUMENTATION :
        https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sherman Xueming Shen
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: