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

Introduce java.util.regex.InterruptibleMatcher

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None

      Description

      The Matcher operations such as find(), match() and lookingAt() can take long time to complete. However, since the Matcher class was not designed to respond to interruption, there is no way to stop those long-running operations.

      It is proposed to introduce a separate class, java.util.regex.InterruptibleMatcher, which will mostly mimic the interface of the non-interruptible java.util.regex.Matcher, but will provide methods find(), match() and lookingAt() that will throw InterruptibleException, if the thread executing those is interrupted.

      Additionally, there will be provided variants of find(long, TimeUnit), match(long, TimeUnit) and lookingAt(long, TimeUnit), that will allow to specify a timeout.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: