test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlorUtilsTest.java
test_class.identifier: BundlorUtilsTest
test_case.body: @Test
      public void matchingProperties_FirstLevel() throws Exception{
          Matcher m = new Include("jcr:content").createMatcher().next("jcr:content");
          Map<String, PropertyState> result = BundlorUtils.getMatchingProperties(
                  create("a",
                          concat("jcr:content", META_PROP_BUNDLING_PATH),
                          "jcr:content/jcr:data",
                          "jcr:content/metadata/format",
                          "jcr:primaryType",
                          META_PROP_PATTERN
                  ), m
          );
          assertThat(result.keySet(), hasItems("jcr:data"));
          assertEquals("jcr:data", result.get("jcr:data").getName());
      }
test_case.class_method_signature: BundlorUtilsTest.matchingProperties_FirstLevel()
test_case.full_signature: @Test public void matchingProperties_FirstLevel()
test_case.identifier: matchingProperties_FirstLevel
test_case.invocations: next createMatcher getMatchingProperties create concat assertThat keySet hasItems assertEquals getName get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void matchingProperties_FirstLevel()
focal_class.declarator: NOT_BUNDLOR_PROPS = new Predicate<PropertyState>() {
          @Override
          public boolean apply(PropertyState input) {
              return !input.getName().startsWith(DocumentBundlor.BUNDLOR_META_PROP_PREFIX);
          }
      }
focal_class.modifier: public static final
focal_class.original_string: public static final Predicate<PropertyState> NOT_BUNDLOR_PROPS = new Predicate<PropertyState>() {
          @Override
          public boolean apply(PropertyState input) {
              return !input.getName().startsWith(DocumentBundlor.BUNDLOR_META_PROP_PREFIX);
          }
      };
focal_class.type: Predicate<PropertyState>
focal_class.var_name: NOT_BUNDLOR_PROPS
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlorUtils.java
focal_class.identifier: BundlorUtils
focal_class.class_method_signature: BundlorUtils.getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)
focal_class.full_signature: public static Map<String, PropertyState> getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)
focal_class.identifier: getMatchingProperties
focal_class.modifiers: public static
focal_class.parameters: (Map<String, PropertyState> props, Matcher matcher)
focal_class.return: Map<String, PropertyState>
focal_class.signature: Map<String, PropertyState> getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)
focal_class.class_method_signature: BundlorUtils.getChildNodeNames(Collection<String> keys, Matcher matcher)
focal_class.full_signature: public static Set<String> getChildNodeNames(Collection<String> keys, Matcher matcher)
focal_class.identifier: getChildNodeNames
focal_class.modifiers: public static
focal_class.parameters: (Collection<String> keys, Matcher matcher)
focal_class.return: Set<String>
focal_class.signature: Set<String> getChildNodeNames(Collection<String> keys, Matcher matcher)
focal_class.class_method_signature: BundlorUtils.isBundlingRoot(NodeState state)
focal_class.full_signature: static boolean isBundlingRoot(NodeState state)
focal_class.identifier: isBundlingRoot
focal_class.modifiers: static
focal_class.parameters: (NodeState state)
focal_class.return: boolean
focal_class.signature: boolean isBundlingRoot(NodeState state)
focal_class.class_method_signature: BundlorUtils.isBundledChild(NodeState state)
focal_class.full_signature: static boolean isBundledChild(NodeState state)
focal_class.identifier: isBundledChild
focal_class.modifiers: static
focal_class.parameters: (NodeState state)
focal_class.return: boolean
focal_class.signature: boolean isBundledChild(NodeState state)
focal_class.class_method_signature: BundlorUtils.isBundledNode(NodeState state)
focal_class.full_signature: static boolean isBundledNode(NodeState state)
focal_class.identifier: isBundledNode
focal_class.modifiers: static
focal_class.parameters: (NodeState state)
focal_class.return: boolean
focal_class.signature: boolean isBundledNode(NodeState state)
focal_method.body: public static Map<String, PropertyState> getMatchingProperties(Map<String, PropertyState> props, Matcher matcher){
          if (!matcher.isMatch()){
              return Collections.emptyMap();
          }
  
          Map<String, PropertyState> result = Maps.newHashMap();
          for (Map.Entry<String, PropertyState> e : props.entrySet()){
              String propertyPath = e.getKey();
  
              //PathUtils.depth include depth for property name. So
              //reduce 1 to get node depth
              int depth = PathUtils.getDepth(propertyPath) - 1;
  
              if (!propertyPath.startsWith(matcher.getMatchedPath())){
                  continue;
              }
  
              if (depth != matcher.depth()){
                  continue;
              }
  
              //Extract property name from relative property path
              final String newKey = PathUtils.getName(propertyPath);
              PropertyState value = e.getValue();
  
              if (depth > 0){
                  value = new PropertyStateWrapper(value){
                      @NotNull
                      @Override
                      public String getName() {
                          return newKey;
                      }
                  };
              }
  
              result.put(newKey, value);
          }
          return result;
      }
focal_method.class_method_signature: BundlorUtils.getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)
focal_method.full_signature: public static Map<String, PropertyState> getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)
focal_method.identifier: getMatchingProperties
focal_method.invocations: isMatch emptyMap newHashMap entrySet getKey getDepth startsWith getMatchedPath depth getName getValue put
focal_method.modifiers: public static
focal_method.parameters: (Map<String, PropertyState> props, Matcher matcher)
focal_method.return: Map<String, PropertyState>
focal_method.signature: Map<String, PropertyState> getMatchingProperties(Map<String, PropertyState> props, Matcher matcher)