Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1490

Unnecessary creation of ParseError and UnparseError objects from ProcessError?

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: deferred
    • Component/s: clean ups
    • Labels:
      None

      Description

      Looking through the Runtime.scala code you will find under doParse and the unparse methods a case statement for when ProcessingErrors are caught.

      Within this statement we do:
      state.setFailed(x.toParseError)

      This seems unnecessary as the ProcessingError is already an object. The toParseError or toUnparseError call on the existing ProcessingError object creates yet another object which is then added to the diagnostics list. This seems wasteful as we're creating a new object for each existing ProcessError object.

      Also, is there a need to make a distinction between ProcessingErrors being either Parse or Unparse errors? Shouldn't we know that just by the fact that we 'got diagnostics' from the Parser or Unparser?

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              twise Taylor Wise
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Tasks