mbeckerle commented on a change in pull request #326: Daffodil 2280 cleanup -
removes backpointers and factory patterns no longer needed
URL: https://github.com/apache/incubator-daffodil/pull/326#discussion_r393760297
##########
File path: daffodil-core/src/main/scala/org/apache/daffodil/dsom/Nesting.scala
##########
@@ -28,117 +29,80 @@ import org.apache.daffodil.exceptions.Assert
*/
case class EnclosingComponentDef(encloser: SchemaComponent, lexicalPosition:
Int)
-trait NestingMixin {
+trait NestingLexicalMixin { self: SchemaComponent =>
/** The lexically enclosing schema component */
def optLexicalParent: Option[SchemaComponent]
- /**
- * Define this for schema components that have back-references to ref
- * objects.
- * So group def to group ref, globalelementdecl to element ref,
- * type to element, base type to derived type.
- *
- * Not for format annotations however. We don't backpoint those to
- * other format annotations that ref them.
- */
- //
- // Uncomment this to chase down these usages and revise them.
- //
- //
- //@deprecated("2019-06-03", "Use enclosingComponentDefs method, and deal
with sharing.")
- protected def enclosingComponentDef: Option[SchemaComponent]
-
- protected def enclosingComponentDefs: Seq[EnclosingComponentDef]
-
def shortSchemaComponentDesignator: String
- /**
- * The enclosing component, and follows back-references
- * from types to their elements, from globalElementDef to
- * elementRefs, from simpleType defs to derived simpletype defs,
- * from global group defs to group refs
- *
- * Note: the enclosing component of a global element or global group
- * referenced from a element ref or group ref, is NOT the ref object, but
the
- * component that contains the ref object
- */
- //
- // Uncomment this to chase down these usages and revise them.
- //
- //
- //@deprecated("2019-06-03", "Rewrite to use lexicalParent or
enclosingComponents methods, and deal with sharing.")
- final lazy val enclosingComponent: Option[SchemaComponent] =
enclosingComponentDef
-
- final lazy val enclosingComponents: Seq[EnclosingComponentDef] = {
- val res = enclosingComponentDefs
- // System.err.println("enclosingComponents: Component " +
this.shortSchemaComponentDesignator + (
- // if (res.isEmpty) " has no enclosing component."
- // else " has enclosing components " + res.map {
_.encloser.shortSchemaComponentDesignator }.mkString(", ")))
- res
- }
-}
-
-/**
- * Mixin for all schema factories and schema components with no
- * backpointers, just a lexical parent. This means all the non-global
- * schema components.
- */
-trait NestingLexicalMixin
- extends NestingMixin { self: SchemaComponent =>
+ private def ue(sc: SchemaComponent) =
Review comment:
fix.
----------------------------------------------------------------
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