stevedlawrence commented on a change in pull request #223: Daffodil 1444 schema
comp simple types
URL: https://github.com/apache/incubator-daffodil/pull/223#discussion_r289965339
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/compiler/Compiler.scala
##########
@@ -315,9 +313,8 @@ class Compiler(var validateDFDLSchemas: Boolean = true)
*/
def compileSource(schemaSource: DaffodilSchemaSource): ProcessorFactory =
Compiler.synchronized {
- val noParent = null // null indicates this is the root, and has no parent
- val sset = new SchemaSet(rootSpec, externalDFDLVariables,
Seq(schemaSource), validateDFDLSchemas, checkAllTopLevel, noParent, tunablesObj)
- val pf = new ProcessorFactory(sset)
+ lazy val sset: SchemaSet = new SchemaSet(Some(pf), rootSpec,
externalDFDLVariables, Seq(schemaSource), validateDFDLSchemas,
checkAllTopLevel, tunablesObj)
+ lazy val pf: ProcessorFactory = new ProcessorFactory(sset)
val err = pf.isError
Review comment:
``Some(pf)`` is pased into the ``new SchemaSet`` constructor, and then we
create a local ``pf`` variable that shadows that. And then pass the schemaset
into that processor factory? What's the pf that's being shadowed? Is it being
inherited from somewhere? Seems odd to passing in a ProcessorFactory to a
schema set, then create a new ProcessorFactory that uses the schema set. Maybe
a variable name should be changed to clarify the difference?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services