Jukka Zitting created OAK-799:
---------------------------------

             Summary: Fail-fast for content diffs
                 Key: OAK-799
                 URL: https://issues.apache.org/jira/browse/OAK-799
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: core
            Reporter: Jukka Zitting
            Assignee: Jukka Zitting


Currently the only way for a {{NodeStateDiff}} implementation to stop a 
{{compareAgainstBaseState()}} operation is to throw an undeclared exception. 
This is troublesome as using exceptions for flow control is bad practice and as 
in some cases short-cutting the comparison operation can notably improve 
performance by avoiding unnecessary work.

Thus I suggest that we add a boolean return value to the {{NodeStateDiff}} 
methods. By returning {{false}}, an implementation could signal the calling 
{{compareAgainstBaseState()}} method to stop the comparison. The return value 
should also be returned by the {{compareAgainstBaseState()}} method so that the 
caller can tell whether the comparison was stopped before completion.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to