mbeckerle commented on a change in pull request #539:
URL: https://github.com/apache/daffodil/pull/539#discussion_r619897555



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PState.scala
##########
@@ -288,7 +285,8 @@ final class PState private (
   }
 
   def currentLocation: DataLocation = {
-    val isAtEnd = !dataInputStream.isDefinedForLength(1)
+    // val isAtEnd = !dataInputStream.isDefinedForLength(1)
+    val isAtEnd = dataInputStream.isAtEnd()

Review comment:
       Arguably, isAtEnd should not be captured into this object at this point, 
and frozen. 
   
   Or rather, the ParseResult object feels like it should be immutable, and all 
characteristics of it taken from the InputSourceDataInputStream (which is 
mutable - can be used to parse again in streaming fashion) should be taken and 
saved. 
   
   The ParseResult isAtEnd feels like it should be frozen at the time the 
parse() returns, subsequent operations on the InputSourceDataInputStream might 
change the isAtEnd status. 




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


Reply via email to