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

VersionablePathHook: Diff.setVersionablePath never results in CommitFailedException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.14.0
    • core, security
    • None

    Description

      I tried to come up with a test case that would result in the VersionablePathHook running into a CommitFailedException upon accessing the version history and found out that this will never occur. In other words, the whole logic to collection CommitFailedException in VersionablePathHook is redundant.

      What I found was that ReadWriteVersionManager.getOrCreateVersionHistory is defined to potentially throw the exception on calling createVersion, which is only triggered if the version history node contains no jcr:rootVersion child. However, createVersion will never throw CommitFailedException if the root version is created as the exception may only occur upon populating the jcr:frozenNode.

      Long story short: introducing ReadWriteVersionManager.createRootVersion and calling it from getOrCreateVersionHistory would simplify createVersion, make the exception declaration redundant and spare us the unused but prominent exception handling code in VersionablePathHook.

      stillalex, mreutegg, i would appreciate if you could review the proposed changes to VersionablePathHook and ReadWriteVersionManager.

      Attachments

        1. OAK-8304.patch
          11 kB
          Angela Schreiber

        Activity

          People

            angela Angela Schreiber
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: