stevedlawrence commented on code in PR #1122:
URL: https://github.com/apache/daffodil/pull/1122#discussion_r1409353815


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/compiler/Compiler.scala:
##########
@@ -92,13 +89,10 @@ final class ProcessorFactory private (
       validateDFDLSchemas,
       checkAllTopLevel,
       tunables,
-      Some(sset),

Review Comment:
   Interestingly, I discovered that `DataProcessor.isError` always returns 
false:
   
   
https://github.com/apache/daffodil/blob/main/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/DataProcessor.scala#L274
   
   This was surprising to me, but this codecov in the TDML runner confirms that 
we do never get a `DataProcessor` with `isError` set to true, at least in any 
of our TDML tests:
   
   
https://app.codecov.io/gh/apache/daffodil/blob/main/daffodil-tdml-processor%2Fsrc%2Fmain%2Fscala%2Forg%2Fapache%2Fdaffodil%2Fprocessor%2Ftdml%2FDaffodilTDMLDFDLProcessor.scala#L107
   
   I think this goes to show how much work is done in 
`ProcessorFactory.isError`, so much so that if we successfully create a 
`ProcessorFactory`, there is no way for Daffodil to fail to create a 
`DataProcessor`. So I think it is pretty important to avoid that extra work if 
a user calls `withDistinguishedRootNode`.
   
   This also means `isError` doesn't do any work in the `DataProcessor`. All 
the work to create a `DataProcessor` is done in `ProcessorFactory.onPath`. Not 
sure it matters, but I didn't realize that was the case. I thought `isError` 
did all the work in both classes.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to