Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1194

Reduce StatementSourceReference proliferation

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 7.0.0
    • parser
    • None

    Description

      We have a large number of users who assume acquiring CommonStmtContext.sourceReference() is cheap, which is not really the case. Most of the time the reference is acquired only for the purposes of throwing an exception – which we rarely really do.

      Refactor SourceException and its subclasses to offer instantiation with CommonStmtCtx, calling sourceReference() only if an exception is about to be thrown.

      This should help with code verbosity as well as improve performance.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              rovarga Robert Varga
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: