Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-799

Fail-fast for content diffs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.7
    • core
    • None

    Description

      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.

      Attachments

        Activity

          People

            jukkaz Jukka Zitting
            jukkaz Jukka Zitting
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: