mbeckerle commented on a change in pull request #343: WIP: Daf 2302 ext var
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r399600814
 
 

 ##########
 File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
 ##########
 @@ -114,70 +150,156 @@ class DataProcessor(
   // not configure the size of the regex match buffers.
   @transient lazy val regexMatchState = new ThreadLocal[(CharBuffer, 
LongBuffer)] {
     override def initialValue = {
-      val cb = 
CharBuffer.allocate(tunablesObj.maximumRegexMatchLengthInCharacters)
-      val lb = 
LongBuffer.allocate(tunablesObj.maximumRegexMatchLengthInCharacters)
+      val cb = 
CharBuffer.allocate(tunables.maximumRegexMatchLengthInCharacters)
+      val lb = 
LongBuffer.allocate(tunables.maximumRegexMatchLengthInCharacters)
       (cb, lb)
     }
   }
 
-  def setValidationMode(mode: ValidationMode.Type): Unit = { 
ssrd.validationMode = mode }
-  def getValidationMode() = ssrd.validationMode
-  def getVariables = ssrd.variables
-  def getTunables = tunablesObj
+  /**
+   * Returns a data processor with the same schema, but with no tunables, no 
external variable bindings,
+   * and the default validation mode.
+   */
+  def clear(): DataProcessor = new DataProcessor(ssrd, tunables)
 
 Review comment:
   Scaladoc is not consistent with behavior. This preserves the tunables. 

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