Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3708

Improve the error stack trace when a StackOverflowError is raised when trying to match a regular expression in the Sonar Channel

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: None
    • Labels:
      None

      Description

      When such error occurs we don't have any way to know :

      • Which regular expression is envolved
      • At which line and which column this error happens
      • In which file we face this issue

      Adding the following piece of code at the end of the CodeReader.popTo(Matcher matcher, Matcher afterMatcher, Appendable appendable) method allows to get at least the two first pieces of information :

          } catch (StackOverflowError e) {
            throw new ChannelException("Unable to apply regular expression '" + matcher.pattern().pattern() + "' at line :"
                + getCursor().getLine() + "and column :" + getCursor().getColumn(), e);
          }
      

        Attachments

          Activity

            People

            Assignee:
            godin OLD - Evgeny Mandrikov
            Reporter:
            freddy.mallet Freddy Mallet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: