Introduce java.util.regex.InterruptibleMatcher

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P3
    • None
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated: