Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9961

DefaultAclManager: redundant creation of intermediate path

    XMLWordPrintableJSON

Details

    Description

      // TODO does it harm?!?
      addSystemUserPath(formatter, systemUser.getPath());
      

      where the method looks as follows:

      private final void addSystemUserPath(Formatter formatter, RepoPath path) {
              if (preProvidedSystemPaths.add(path)) {
                  formatter.format("create path (rep:AuthorizableFolder) %s%n", path);
              }
          }
      

      i would strong recommend to drop that. the content-package-feature-model-converter already has quite some hardcoded stuff.... how the intermediate path argument passed to UserManager.createSystemUser(String id, String intermediatePath) is used and what node types are used to create the hierarchy should be considered an implementation detail and it doesn't make sense IMHO to eagerly create the tree structure in a feature like this. in fact i would consider this a bug that may sooner or later cause the converter to fail during repo-init execution.

      btw: the comment already implies that the author was not sure of the usefulness.... why not verifying and fixing the code or dropping the TODO before releasing the module?

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: