jadams-tresys commented on a change in pull request #369:
URL: https://github.com/apache/incubator-daffodil/pull/369#discussion_r415811531
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/VariableMap1.scala
##########
@@ -185,96 +224,84 @@ class VariableMap private(vTable: Map[GlobalQName,
List[List[Variable]]])
* shows that the variable has been read (state VariableRead), when the
variable hadn't
* previously been read yet.
*/
- def readVariable(vrd: VariableRuntimeData, referringContext: ThrowsSDE):
(DataValuePrimitive, VariableMap) = {
+ def readVariable(vrd: VariableRuntimeData, referringContext: ThrowsSDE):
DataValuePrimitive = {
val referringContext: VariableRuntimeData = vrd
val varQName = vrd.globalQName
- val lists = vTable.get(varQName)
- lists match {
-
- case Some(firstTier :: enclosingScopes) =>
- firstTier match {
-
- case Variable(VariableRead, v, ctxt, _) :: rest if (v.isDefined) =>
(v.getNonNullable, this)
-
- case Variable(st, v, ctxt, defExpr) :: rest if ((v.isDefined) && (st
== VariableDefined || st == VariableSet)) => {
- val newVar = Variable(VariableRead, v, ctxt, defExpr)
- val vmap = mkVMapForNewVariable(newVar, firstTier, enclosingScopes)
- val converted = v.getNonNullable // already converted
- (converted, vmap)
- }
-
- case _ => {
- // Fix DFDL-766
- throw new VariableHasNoValue(varQName, referringContext)
- // Runtime error:
- // referringContext.SDE(msg, varQName)
- }
+ val stack = vTable.get(varQName)
Review comment:
I think I'm in favour of just removing it as nothing ended up using it
and it isn't really providing any additional functionality beyond the
vTable.get() call.
----------------------------------------------------------------
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]