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

Reduce StatementSourceReference proliferation

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.0
    • None
    • parser
    • None

      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.

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

              Created:
              Updated:
              Resolved: