Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10474

Avoid throwing StackOverflowError when creating RegExp

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • core/other
    • None
    • New

    Description

      Creating a regular expression using Lucene's RegExp class can easily result in a StackOverflowError being thrown, for example when the input is larger than the maximum stack depth. Throwing a StackOverflowError isn't something a user would expect, and it isn't documented either. StackOverflowError is a user-unfriendly exception as it does not convey any intent that the user has done something wrong, but suggests a bug in the implementation.

      I would like Lucene to follow the approach taken by the JDK and throw an IllegalArgumentException instead to clearly mark this as an input that the implementation can't handle.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ywelsch Yannick Welsch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m