test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/restriction/GlobPatternTest.java
test_class.identifier: GlobPatternTest
test_case.body: @Test
      public void testMatchesWildcardAll() {
  
          Map<String,Boolean> tests = new HashMap<>();
  
          // restriction "*" matches /foo, all siblings of foo and foo's and the siblings' descendants
          GlobPattern gp = GlobPattern.create("/a/b/c", "*");
          // matching
          tests.put("/a/b/c", true);        // foo itself
          tests.put("/a/b/c/d", true);      // child of foo
          tests.put("/a/b/c/d/e", true);    // child of foo
          tests.put("/a/b/c/d/e/f", true);  // child of foo
          tests.put("/a/b/cde", true);      // sibling
          tests.put("/a/b/cde/e/f", true);  // child of the sibling
          // not-matching
          tests.put("/", false);
          tests.put("/a", false);
          tests.put("/b/c", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // restriction "*cat" matches all siblings and descendants of /foo that have a name ending with cat
          gp = GlobPattern.create("/a/b/c", "*e");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/e", true);      // descendant with name segment 'e'
          tests.put("/a/b/c/d/e", true);    // descendant with name segment 'e'
          tests.put("/a/b/c/gge", true);    // descendant with name segment ending with 'e'
          tests.put("/a/b/c/d/gge", true);  // descendant with name segment ending with 'e'
          tests.put("/a/b/ce", true);       // sibling whose name ends with 'e'
          tests.put("/a/b/chee", true);     // sibling whose name ends with 'e'
          tests.put("/a/b/cd/e", true);     // descendant of sibling named 'e'
          tests.put("/a/b/cd/f/e", true);   // descendant of sibling named 'e'
          tests.put("/a/b/cd/name", true);     // descendant of sibling with name ending with 'e'
          tests.put("/a/b/cd/f/name", true);   // descendant of sibling with name ending with 'e'
          // not-matching
          tests.put("/", false);
          tests.put("/a", false);
          tests.put("/b/c", false);
          tests.put("/a/b/c", false);
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/e/f", false);
          tests.put("/a/b/c/d/f/e/f", false);
          tests.put("/a/b/c/d/f/efg", false);
          tests.put("/a/b/c/d/f/f", false);
          tests.put("/a/b/c/e/f", false);
          tests.put("/a/b/ce/", false);
          tests.put("/a/b/ceg", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // restriction "*/cat" matches all descendants of /foo and foo's siblings that have a name segment "cat"
          gp = GlobPattern.create("/a/b/c", "*/e");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/e", true);      // descendant with name segment 'e'
          tests.put("/a/b/c/d/e", true);    // descendant with name segment 'e'
          tests.put("/a/b/cd/e", true);     // descendant of sibling named 'e'
          tests.put("/a/b/cd/f/e", true);   // descendant of sibling named 'e'
          // not-matching
          tests.put("/", false);
          tests.put("/a", false);
          tests.put("/b/c", false);
          tests.put("/a/b/c", false);
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/e/f", false);
          tests.put("/a/b/c/d/f/e/f", false);
          tests.put("/a/b/c/d/f/efg", false);
          tests.put("/a/b/c/d/f/f", false);
          tests.put("/a/b/c/e/f", false);
          tests.put("/a/b/ce/", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // matches target path '/a/b/c/e', all siblings whose name starts with e
          // and child nodes of either.
          gp = GlobPattern.create("/a/b/c/e", "*");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/e/f/g/h", true);
          tests.put("/a/b/c/e/d/e/f", true);
          tests.put("/a/b/c/e/d/e/g", true);
          tests.put("/a/b/c/e", true);
          tests.put("/a/b/c/e/", true);
          tests.put("/a/b/c/ef", true);
          tests.put("/a/b/c/ef/g", true);
          // not-matching
          tests.put("/a/b/ce/f/g/h", false);
          tests.put("/a/b/ce/d/e/f", false);
          tests.put("/a/b/c", false);
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/e/f", false);
          tests.put("/a/b/c/d/f/f", false);
          tests.put("/a/b/c/d/f/e/f", false);
          tests.put("/a/b/cee/d/e/f", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // all descendants of '/a/b/c/e'
          gp = GlobPattern.create("/a/b/c/e", "/*");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/e/f/g/h", true);
          tests.put("/a/b/c/e/d/e/f", true);
          // not-matching
          tests.put("/a/b/c/e", false);  // not matching node path
          tests.put("/a/b/c/e/", false); // not matching node path + /
          tests.put("/a/b/c/ef", false); // not matching siblings of node path
          tests.put("/a/b/ce/f/g/h", false);
          tests.put("/a/b/ce/d/e/f", false);
          tests.put("/a/b/c", false);
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/e", false);
          tests.put("/a/b/c/d/e/f", false);
          tests.put("/a/b/c/d/f/f", false);
          tests.put("/a/b/c/d/f/e/f", false);
          tests.put("/a/b/cee/d/e/f", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // all descendants of '/a/b/ce'
          gp = GlobPattern.create("/a/b/c", "e/*");
          tests = new HashMap<>();
          // not-matching
          tests.put("/a/b/ce/f/g/h", true);
          tests.put("/a/b/ce/d/e/f", true);
          // not-matching
          tests.put("/a/b/c", false);
          tests.put("/a/b/ce", false);
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/e", false);
          tests.put("/a/b/c/d/e/f", false);
          tests.put("/a/b/c/d/f/f", false);
          tests.put("/a/b/c/d/f/e/f", false);
          tests.put("/a/b/cee/d/e/f", false);
          tests.put("/a/b/ce/", false);       // missing * after ce/
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // all descendants of '/'
          gp = GlobPattern.create("/", "*");
          tests = new HashMap<>();
          // matching
          tests.put("/a", true);
          tests.put("/b/", true);
          tests.put("/c/d", true);
          tests.put("/a/b/ce/", true);
          tests.put("/a/b/ce/f/g/h", true);
          tests.put("/a/b/ce/d/e/f", true);
          // not-matching
          tests.put("/", false);
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          // restriction "*cat/*" matches all siblings and descendants of /foo that have an intermediate segment ending with 'cat'
          gp = GlobPattern.create("/a/b/c", "*e/*");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/ceeeeeee/f/g/h", true);
          tests.put("/a/b/cde/d/e/f", true);
          tests.put("/a/b/c/d/e/f", true);
          tests.put("/a/b/ced/d/e/f", true);
          // not-matching
          tests.put("/a/b/cde", false);      // sibling ending with e
          tests.put("/a/b/ce/", false);      // ignore trailing / in test path
          tests.put("/a/b/c/d/e/", false);   // ignore trailing / in test path
          tests.put("/a/b/c/d", false);      // missing *e/*
          tests.put("/a/b/c/d/e", false);    // missing /*
          tests.put("/a/b/c/d/f/f", false);  // missing *e
          tests.put("/a/b/c/ed/f/f", false); // missing e/
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          //  restriction /*cat/*  matches all descendants of /foo that have an intermediate segment ending with 'cat'
          gp = GlobPattern.create("/a/b/c", "/*e/*");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/d/e/f", true);
          tests.put("/a/b/c/de/f", true);
          // not-matching
          tests.put("/a/b/cde", false);      // sibling ending with e
          tests.put("/a/b/ced/d/e/f", false);// sibling containing intermediate segment
          tests.put("/a/b/cde/d/e/f", false);// sibling containing intermediate segment
          tests.put("/a/b/ce/", false);      // ignore trailing / in test path
          tests.put("/a/b/c/d/e/", false);   // ignore trailing / in test path
          tests.put("/a/b/c/d/f", false);    // no intermediate segment
          tests.put("/a/b/c/d", false);      // missing *e/*
          tests.put("/a/b/c/d/e", false);    // missing /*
          tests.put("/a/b/c/d/f/f", false);  // missing *e
          tests.put("/a/b/c/ed/f/f", false); // missing e/
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          //  restriction /*cat  matches all children of /a/b/c whose path ends with "cat"
          gp = GlobPattern.create("/a/b/c", "/*cat");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/cat", true);
          tests.put("/a/b/c/acat", true);
          tests.put("/a/b/c/f/cat", true);
          tests.put("/a/b/c/f/acat", true);
          // not-matching
          tests.put("/a/b/c/d", false);
          tests.put("/a/b/c/d/cat/e", false);  // cat only intermediate segment
          tests.put("/a/b/c/d/acat/e", false);  // cat only intermediate segment
          tests.put("/a/b/c/d/cata/e", false);  // cat only intermediate segment
          tests.put("/a/b/c/d/cate", false);
          tests.put("/a/b/cat", false);        // siblings do no match
          tests.put("/a/b/cat/ed/f/f", false); // ... nor do siblings' children
          tests.put("/a/b/ced/cat", false);    // ... nor do siblings' children
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          //  restriction /*/cat  matches all non-direct descendants of /foo named "cat"
          gp = GlobPattern.create("/a/b/c", "/*/cat");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/a/cat", true);
          tests.put("/a/b/c/d/e/f/cat", true);
          // not-matching
          tests.put("/a/b/c/cat", false);
          tests.put("/a/b/c/cate", false);
          tests.put("/a/b/c/acat", false);
          tests.put("/a/b/c/cat/d", false);
          tests.put("/a/b/c/d/acat", false);
          tests.put("/a/b/c/d/cate", false);
          tests.put("/a/b/c/d/cat/e", false);   // cat only intermediate segment
          tests.put("/a/b/c/d/acat/e", false);  // cat only intermediate segment
          tests.put("/a/b/c/d/cata/e", false);  // cat only intermediate segment
          tests.put("/a/b/cat", false);        // siblings do no match
          tests.put("/a/b/cat/ed/f/f", false); // ... nor do siblings' children
          tests.put("/a/b/ced/cat", false);    // ... nor do siblings' children
          tests.put("/a/b/ced/f/cat", false);  // ... nor do siblings' children
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
  
          //  restriction /cat* matches all descendant paths of /foo that have the
          //  direct foo-descendant segment starting with "cat"
          gp = GlobPattern.create("/a/b/c", "/cat*");
          tests = new HashMap<>();
          // matching
          tests.put("/a/b/c/cat", true);
          tests.put("/a/b/c/cats", true);
          tests.put("/a/b/c/cat/s", true);
          tests.put("/a/b/c/cats/d/e/f", true);
          // not-matching
          tests.put("/a/b/c/d/cat", false);
          tests.put("/a/b/c/d/cats", false);
          tests.put("/a/b/c/d/e/cat", false);
          tests.put("/a/b/c/d/e/cats", false);
          tests.put("/a/b/c/acat", false);
          tests.put("/a/b/c/d/acat", false);
          tests.put("/a/b/c/d/cat/e", false);
          tests.put("/a/b/c/d/acat/e", false);
          tests.put("/a/b/c/d/cata/e", false);
          tests.put("/a/b/cat", false);        // siblings do no match
          tests.put("/a/b/cat/ed/f/f", false); // ... nor do siblings' children
          tests.put("/a/b/ced/cat", false);    // ... nor do siblings' children
          tests.put("/a/b/ced/f/cat", false);  // ... nor do siblings' children
  
          for (String testPath : tests.keySet()) {
              assertMatch(gp, testPath, tests.get(testPath));
          }
      }
test_case.class_method_signature: GlobPatternTest.testMatchesWildcardAll()
test_case.full_signature: @Test public void testMatchesWildcardAll()
test_case.identifier: testMatchesWildcardAll
test_case.invocations: create put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put keySet assertMatch get create put put put put put put put keySet assertMatch get create put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put put keySet assertMatch get create put put put put put put put put put put put put put put put put put keySet assertMatch get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMatchesWildcardAll()
focal_class.declarator: WILDCARD_CHAR = '*'
focal_class.modifier: private static final
focal_class.original_string: private static final char WILDCARD_CHAR = '*';
focal_class.type: char
focal_class.var_name: WILDCARD_CHAR
focal_class.declarator: MAX_WILDCARD = 20
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_WILDCARD = 20;
focal_class.type: int
focal_class.var_name: MAX_WILDCARD
focal_class.declarator: path
focal_class.modifier: private final
focal_class.original_string: private final String path;
focal_class.type: String
focal_class.var_name: path
focal_class.declarator: restriction
focal_class.modifier: private final
focal_class.original_string: private final String restriction;
focal_class.type: String
focal_class.var_name: restriction
focal_class.declarator: pattern
focal_class.modifier: private final
focal_class.original_string: private final Pattern pattern;
focal_class.type: Pattern
focal_class.var_name: pattern
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/GlobPattern.java
focal_class.identifier: GlobPattern
focal_class.interfaces: implements RestrictionPattern
focal_class.class_method_signature: GlobPattern.GlobPattern(@NotNull String path, @NotNull String restriction)
focal_class.full_signature: private  GlobPattern(@NotNull String path, @NotNull String restriction)
focal_class.identifier: GlobPattern
focal_class.modifiers: private
focal_class.parameters: (@NotNull String path, @NotNull String restriction)
focal_class.signature:  GlobPattern(@NotNull String path, @NotNull String restriction)
focal_class.class_method_signature: GlobPattern.create(@NotNull String nodePath, @NotNull String restrictions)
focal_class.full_signature: static GlobPattern create(@NotNull String nodePath, @NotNull String restrictions)
focal_class.identifier: create
focal_class.modifiers: static
focal_class.parameters: (@NotNull String nodePath, @NotNull String restrictions)
focal_class.return: GlobPattern
focal_class.signature: GlobPattern create(@NotNull String nodePath, @NotNull String restrictions)
focal_class.class_method_signature: GlobPattern.validate(@NotNull String restriction)
focal_class.full_signature: static void validate(@NotNull String restriction)
focal_class.identifier: validate
focal_class.modifiers: static
focal_class.parameters: (@NotNull String restriction)
focal_class.return: void
focal_class.signature: void validate(@NotNull String restriction)
focal_class.class_method_signature: GlobPattern.matches(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.full_signature: @Override public boolean matches(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.identifier: matches
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Tree tree, @Nullable PropertyState property)
focal_class.return: boolean
focal_class.signature: boolean matches(@NotNull Tree tree, @Nullable PropertyState property)
focal_class.class_method_signature: GlobPattern.matches(@NotNull String path)
focal_class.full_signature: @Override public boolean matches(@NotNull String path)
focal_class.identifier: matches
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull String path)
focal_class.return: boolean
focal_class.signature: boolean matches(@NotNull String path)
focal_class.class_method_signature: GlobPattern.matches()
focal_class.full_signature: @Override public boolean matches()
focal_class.identifier: matches
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean matches()
focal_class.class_method_signature: GlobPattern.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: GlobPattern.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: GlobPattern.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_method.body: static GlobPattern create(@NotNull String nodePath, @NotNull String restrictions) {
          return new GlobPattern(nodePath, restrictions);
      }
focal_method.class_method_signature: GlobPattern.create(@NotNull String nodePath, @NotNull String restrictions)
focal_method.full_signature: static GlobPattern create(@NotNull String nodePath, @NotNull String restrictions)
focal_method.identifier: create
focal_method.modifiers: static
focal_method.parameters: (@NotNull String nodePath, @NotNull String restrictions)
focal_method.return: GlobPattern
focal_method.signature: GlobPattern create(@NotNull String nodePath, @NotNull String restrictions)