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

Unnecessary creation of ParseError and UnparseError objects from ProcessError?

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • deferred
    • None
    • clean ups
    • None

      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?

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

                Created:
                Updated: