jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Deparvu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OAK-8304) VersionablePathHook: Diff.setVersionablePath never results in CommitFailedException
Date Thu, 09 May 2019 08:45:00 GMT

    [ https://issues.apache.org/jira/browse/OAK-8304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16836201#comment-16836201

Alex Deparvu commented on OAK-8304:

+1 looks good to me

> VersionablePathHook: Diff.setVersionablePath never results in CommitFailedException
> -----------------------------------------------------------------------------------
>                 Key: OAK-8304
>                 URL: https://issues.apache.org/jira/browse/OAK-8304
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core, security
>            Reporter: angela
>            Assignee: angela
>            Priority: Major
>         Attachments: OAK-8304.patch
> 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}}.

This message was sent by Atlassian JIRA

View raw message