You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/06/08 15:36:43 UTC

[GitHub] [sling-org-apache-sling-jcr-repoinit] anchela commented on pull request #19: SLING-10463 - "create path" should fail if a property exists at the same path

anchela commented on pull request #19:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/19#issuecomment-856877644


   @bdelacretaz somehow can't comment directly on the affect lines. here what i would suggest to change.
   instead of 
   ```
           if (session.propertyExists(fullPath)) {
                           throw new RuntimeException("Error creating Node at " + fullPath + ": a property exists with the same path");
                   } else if (session.itemExists(fullPath)) {
                           log.info("Path already exists, nothing to do (and not checking its primary type for now");
                  } else ...
   ```
   i would rather write:
   ```
           if (session.propertyExists(fullPath)) {
                           throw new RuntimeException("Error creating Node at " + fullPath + ": a property exists with the same path");
                   } else if (session.nodeExists(fullPath)) {
                           log.info("Node already exists, nothing to do (and not checking its primary type for now");
                  } else ...
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org