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

Introduce java.util.regex.InterruptibleMatcher

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      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.

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

              Created:
              Updated: