JCR-3777 (merge changes made with rev. 1592881, 1597717, 1597806)

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.8@1597807 13f79535-47bb-0310-9956-ffa450edef68