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

Audit, optimize and explicitly test YANG string unescaping

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 5.0.0, 4.0.8, 3.0.11
    • parser

    Description

      ArgumentContextUtils.stringFromStringContext() performs all the magic required to process YANG string handling, including proper quotes validation, unescaping and whitespace trimming. The unescaping part is using three nested Pattern.matchers() and did crop up in profiling runs.

      There are a few things we can do here, most notably we should be able to turn the entire class into an enum with one constant per YangVersion, so that we would not pass that as an argument.

      The pattern substitutions look a bit dodgy, and in some cases we are already performing a char-by-char walk, hence we should be able to remove the patterns completely. For that we need a proper test suite - some of which is in Bug6180Test, but we probably want to promote that to a suite providing 100% branch coverage (including pattern noop vs. real-op).

      Attachments

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

        Activity

          People

            vladyslav.marchenko Vladyslav Marchenko
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: