Shanedell commented on code in PR #875:
URL: https://github.com/apache/daffodil/pull/875#discussion_r1025527040


##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:
##########
@@ -128,24 +120,20 @@ object DataProcessor {
  * back-end runtime.
  */
 class DataProcessor private (
-  //
-  // Once the deprecated API goes away, these var can become val.
-  //
-  var ssrd: SchemaSetRuntimeData,
-  var tunables: DaffodilTunables, // Compiler-set tunables
-  var variableMap: VariableMap,
+  val ssrd: SchemaSetRuntimeData,
+  val tunables: DaffodilTunables, // Compiler-set tunables
+  val variableMap: VariableMap,
   //
   // The below do not need to be transient
   // because this object itself isn't serialized. A SerializableDataProcessor 
is.
   // The values these will have (since this is a base class) are the correct 
default values that we want
   // back when the object is re-initialized.
   //
-  protected var areDebugging : Boolean,
-  protected var optDebugger : Option[Debugger],
+  protected val areDebugging : Boolean,
+  protected val optDebugger : Option[Debugger],
   var validationMode: ValidationMode.Type,
   private var externalVars: Queue[Binding])

Review Comment:
   Not without other updates, I did try to update them to be `vals` however 
these errors are thrown
   
   ```scala
   [error] 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:324:27:
 reassignment to val
   [error]     dpToSave.externalVars = Queue.empty[Binding] // explicitly set 
these to empty so restored processor won't have them.
   [error]                           ^
   [error] 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:325:29:
 reassignment to val
   [error]     dpToSave.validationMode = ValidationMode.Off // explicitly turn 
off, so restored processor won't be validating.
   [error]                             ^
   [error] two errors found
   ```



##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:
##########
@@ -128,24 +120,20 @@ object DataProcessor {
  * back-end runtime.
  */
 class DataProcessor private (
-  //
-  // Once the deprecated API goes away, these var can become val.
-  //
-  var ssrd: SchemaSetRuntimeData,
-  var tunables: DaffodilTunables, // Compiler-set tunables
-  var variableMap: VariableMap,
+  val ssrd: SchemaSetRuntimeData,
+  val tunables: DaffodilTunables, // Compiler-set tunables
+  val variableMap: VariableMap,
   //
   // The below do not need to be transient
   // because this object itself isn't serialized. A SerializableDataProcessor 
is.
   // The values these will have (since this is a base class) are the correct 
default values that we want
   // back when the object is re-initialized.
   //
-  protected var areDebugging : Boolean,
-  protected var optDebugger : Option[Debugger],
+  protected val areDebugging : Boolean,
+  protected val optDebugger : Option[Debugger],
   var validationMode: ValidationMode.Type,
   private var externalVars: Queue[Binding])

Review Comment:
   @stevedlawrence  Not without other updates, I did try to update them to be 
`vals` however these errors are thrown
   
   ```scala
   [error] 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:324:27:
 reassignment to val
   [error]     dpToSave.externalVars = Queue.empty[Binding] // explicitly set 
these to empty so restored processor won't have them.
   [error]                           ^
   [error] 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala:325:29:
 reassignment to val
   [error]     dpToSave.validationMode = ValidationMode.Off // explicitly turn 
off, so restored processor won't be validating.
   [error]                             ^
   [error] two errors found
   ```



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