mbeckerle commented on a change in pull request #223: Daffodil 1444 schema comp 
simple types
URL: https://github.com/apache/incubator-daffodil/pull/223#discussion_r289995419
 
 

 ##########
 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:
   I will add comments to the effect that these two objects are mutually 
referencing each other, and this is the idiom in scala for creating a circular 
reference chain without having to have a side-effecting assignment that may or 
may not have happened by the time you reference it. 
   

----------------------------------------------------------------
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

Reply via email to