test_class.declarator: typeRoot
test_class.modifier: private
test_class.original_string: private Tree typeRoot;
test_class.type: Tree
test_class.var_name: typeRoot
test_class.declarator: propDef
test_class.modifier: private
test_class.original_string: private Tree propDef;
test_class.type: Tree
test_class.var_name: propDef
test_class.declarator: ntDef
test_class.modifier: private
test_class.original_string: private Tree ntDef;
test_class.type: Tree
test_class.var_name: ntDef
test_class.file: oak-security-spi/src/test/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtilTest.java
test_class.identifier: TreeUtilTest
test_class.superclass: extends AbstractTreeTest
test_case.body: @Test
      public void testGetDefaultChildTypeFromResidual() {
          Tree emptyDefinitions = when(mock(Tree.class).getChildren()).thenReturn(ImmutableList.of()).getMock();
          Tree named = when(mock(Tree.class).getChild("newChild")).thenReturn(emptyDefinitions).getMock();
          when(ntDef.getChild(REP_NAMED_CHILD_NODE_DEFINITIONS)).thenReturn(named);
  
          Tree def = mock(Tree.class);
          PropertyState ps = PropertyStates.createProperty(JCR_DEFAULTPRIMARYTYPE, NT_RESOURCE, Type.NAME);
          when(def.getProperty(JCR_DEFAULTPRIMARYTYPE)).thenReturn(ps);
          PropertyState sns = PropertyStates.createProperty(JCR_SAMENAMESIBLINGS, false, Type.BOOLEAN);
          when(def.getProperty(JCR_SAMENAMESIBLINGS)).thenReturn(sns);
          Tree definitions = when(mock(Tree.class).getChildren()).thenReturn(ImmutableList.of(def)).getMock();
          when(ntDef.getChild(REP_RESIDUAL_CHILD_NODE_DEFINITIONS)).thenReturn(definitions);
  
          assertEquals(NT_RESOURCE, TreeUtil.getDefaultChildType(typeRoot, child, "newChild"));
          assertNull(TreeUtil.getDefaultChildType(typeRoot, child, "newChild[4]"));
      }
test_case.class_method_signature: TreeUtilTest.testGetDefaultChildTypeFromResidual()
test_case.full_signature: @Test public void testGetDefaultChildTypeFromResidual()
test_case.identifier: testGetDefaultChildTypeFromResidual
test_case.invocations: getMock thenReturn when getChildren mock of getMock thenReturn when getChild mock thenReturn when getChild mock createProperty thenReturn when getProperty createProperty thenReturn when getProperty getMock thenReturn when getChildren mock of thenReturn when getChild assertEquals getDefaultChildType assertNull getDefaultChildType
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetDefaultChildTypeFromResidual()
focal_class.file: oak-security-spi/src/main/java/org/apache/jackrabbit/oak/plugins/tree/TreeUtil.java
focal_class.identifier: TreeUtil
focal_class.class_method_signature: TreeUtil.TreeUtil()
focal_class.full_signature: private  TreeUtil()
focal_class.identifier: TreeUtil
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  TreeUtil()
focal_class.class_method_signature: TreeUtil.getPrimaryTypeName(@NotNull Tree tree)
focal_class.full_signature: @Nullable public static String getPrimaryTypeName(@NotNull Tree tree)
focal_class.identifier: getPrimaryTypeName
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: String
focal_class.signature: String getPrimaryTypeName(@NotNull Tree tree)
focal_class.class_method_signature: TreeUtil.getPrimaryTypeName(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.full_signature: @Nullable public static String getPrimaryTypeName(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.identifier: getPrimaryTypeName
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.return: String
focal_class.signature: String getPrimaryTypeName(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.class_method_signature: TreeUtil.getMixinTypeNames(@NotNull Tree tree)
focal_class.full_signature: @NotNull public static Iterable<String> getMixinTypeNames(@NotNull Tree tree)
focal_class.identifier: getMixinTypeNames
focal_class.modifiers: @NotNull public static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getMixinTypeNames(@NotNull Tree tree)
focal_class.class_method_signature: TreeUtil.getMixinTypeNames(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.full_signature: @NotNull public static Iterable<String> getMixinTypeNames(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.identifier: getMixinTypeNames
focal_class.modifiers: @NotNull public static
focal_class.parameters: (@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getMixinTypeNames(@NotNull Tree tree, @NotNull LazyValue<Tree> readOnlyTree)
focal_class.class_method_signature: TreeUtil.getStrings(@NotNull Tree tree, @NotNull String propertyName)
focal_class.full_signature: @Nullable public static Iterable<String> getStrings(@NotNull Tree tree, @NotNull String propertyName)
focal_class.identifier: getStrings
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String propertyName)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getStrings(@NotNull Tree tree, @NotNull String propertyName)
focal_class.class_method_signature: TreeUtil.getString(@NotNull Tree tree, @NotNull String propertyName)
focal_class.full_signature: @Nullable public static String getString(@NotNull Tree tree, @NotNull String propertyName)
focal_class.identifier: getString
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String propertyName)
focal_class.return: String
focal_class.signature: String getString(@NotNull Tree tree, @NotNull String propertyName)
focal_class.class_method_signature: TreeUtil.getString(@NotNull Tree tree, @NotNull String name, @Nullable String defaultValue)
focal_class.full_signature: @Nullable public static String getString(@NotNull Tree tree, @NotNull String name, @Nullable String defaultValue)
focal_class.identifier: getString
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String name, @Nullable String defaultValue)
focal_class.return: String
focal_class.signature: String getString(@NotNull Tree tree, @NotNull String name, @Nullable String defaultValue)
focal_class.class_method_signature: TreeUtil.getStringInternal(@NotNull Tree tree,
                                              @NotNull String propertyName,
                                              @NotNull Type<String> type)
focal_class.full_signature: @Nullable private static String getStringInternal(@NotNull Tree tree,
                                              @NotNull String propertyName,
                                              @NotNull Type<String> type)
focal_class.identifier: getStringInternal
focal_class.modifiers: @Nullable private static
focal_class.parameters: (@NotNull Tree tree,
                                              @NotNull String propertyName,
                                              @NotNull Type<String> type)
focal_class.return: String
focal_class.signature: String getStringInternal(@NotNull Tree tree,
                                              @NotNull String propertyName,
                                              @NotNull Type<String> type)
focal_class.class_method_signature: TreeUtil.getBoolean(@NotNull Tree tree, @NotNull String propertyName)
focal_class.full_signature: public static boolean getBoolean(@NotNull Tree tree, @NotNull String propertyName)
focal_class.identifier: getBoolean
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String propertyName)
focal_class.return: boolean
focal_class.signature: boolean getBoolean(@NotNull Tree tree, @NotNull String propertyName)
focal_class.class_method_signature: TreeUtil.getName(@NotNull Tree tree, @NotNull String name)
focal_class.full_signature: @Nullable public static String getName(@NotNull Tree tree, @NotNull String name)
focal_class.identifier: getName
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String name)
focal_class.return: String
focal_class.signature: String getName(@NotNull Tree tree, @NotNull String name)
focal_class.class_method_signature: TreeUtil.getNames(@NotNull Tree tree, @NotNull String name)
focal_class.full_signature: @NotNull public static Iterable<String> getNames(@NotNull Tree tree, @NotNull String name)
focal_class.identifier: getNames
focal_class.modifiers: @NotNull public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String name)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> getNames(@NotNull Tree tree, @NotNull String name)
focal_class.class_method_signature: TreeUtil.getLong(@NotNull Tree tree, @NotNull String name, long defaultValue)
focal_class.full_signature: public static long getLong(@NotNull Tree tree, @NotNull String name, long defaultValue)
focal_class.identifier: getLong
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String name, long defaultValue)
focal_class.return: long
focal_class.signature: long getLong(@NotNull Tree tree, @NotNull String name, long defaultValue)
focal_class.class_method_signature: TreeUtil.getTree(@NotNull Tree tree, @NotNull String path)
focal_class.full_signature: @Nullable public static Tree getTree(@NotNull Tree tree, @NotNull String path)
focal_class.identifier: getTree
focal_class.modifiers: @Nullable public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String path)
focal_class.return: Tree
focal_class.signature: Tree getTree(@NotNull Tree tree, @NotNull String path)
focal_class.class_method_signature: TreeUtil.addChild(
              @NotNull Tree parent, @NotNull String name,
              @Nullable String typeName, @NotNull Tree typeRoot,
              @Nullable String userID)
focal_class.full_signature: public static Tree addChild(
              @NotNull Tree parent, @NotNull String name,
              @Nullable String typeName, @NotNull Tree typeRoot,
              @Nullable String userID)
focal_class.identifier: addChild
focal_class.modifiers: public static
focal_class.parameters: (
              @NotNull Tree parent, @NotNull String name,
              @Nullable String typeName, @NotNull Tree typeRoot,
              @Nullable String userID)
focal_class.return: Tree
focal_class.signature: Tree addChild(
              @NotNull Tree parent, @NotNull String name,
              @Nullable String typeName, @NotNull Tree typeRoot,
              @Nullable String userID)
focal_class.class_method_signature: TreeUtil.addChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.full_signature: @NotNull public static Tree addChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.identifier: addChild
focal_class.modifiers: @NotNull public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.return: Tree
focal_class.signature: Tree addChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.class_method_signature: TreeUtil.getOrAddChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.full_signature: @NotNull public static Tree getOrAddChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.identifier: getOrAddChild
focal_class.modifiers: @NotNull public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.return: Tree
focal_class.signature: Tree getOrAddChild(@NotNull Tree tree, @NotNull String childName, @NotNull String primaryTypeName)
focal_class.class_method_signature: TreeUtil.addMixin(@NotNull Tree tree, @NotNull String mixinName, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.full_signature: public static void addMixin(@NotNull Tree tree, @NotNull String mixinName, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.identifier: addMixin
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree, @NotNull String mixinName, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.return: void
focal_class.signature: void addMixin(@NotNull Tree tree, @NotNull String mixinName, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.class_method_signature: TreeUtil.autoCreateItems(@NotNull Tree tree, @NotNull Tree type, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.full_signature: public static void autoCreateItems(@NotNull Tree tree, @NotNull Tree type, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.identifier: autoCreateItems
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree, @NotNull Tree type, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.return: void
focal_class.signature: void autoCreateItems(@NotNull Tree tree, @NotNull Tree type, @NotNull Tree typeRoot, @Nullable String userID)
focal_class.class_method_signature: TreeUtil.autoCreateProperty(@NotNull String name,
                                                     @NotNull Tree definition,
                                                     @Nullable String userID)
focal_class.full_signature: public static PropertyState autoCreateProperty(@NotNull String name,
                                                     @NotNull Tree definition,
                                                     @Nullable String userID)
focal_class.identifier: autoCreateProperty
focal_class.modifiers: public static
focal_class.parameters: (@NotNull String name,
                                                     @NotNull Tree definition,
                                                     @Nullable String userID)
focal_class.return: PropertyState
focal_class.signature: PropertyState autoCreateProperty(@NotNull String name,
                                                     @NotNull Tree definition,
                                                     @Nullable String userID)
focal_class.class_method_signature: TreeUtil.getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)
focal_class.full_signature: public static String getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)
focal_class.identifier: getDefaultChildType
focal_class.modifiers: public static
focal_class.parameters: (
              Tree typeRoot, Tree parent, String childName)
focal_class.return: String
focal_class.signature: String getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)
focal_class.class_method_signature: TreeUtil.getEffectiveType(Tree tree, Tree typeRoot)
focal_class.full_signature: public static List<Tree> getEffectiveType(Tree tree, Tree typeRoot)
focal_class.identifier: getEffectiveType
focal_class.modifiers: public static
focal_class.parameters: (Tree tree, Tree typeRoot)
focal_class.return: List<Tree>
focal_class.signature: List<Tree> getEffectiveType(Tree tree, Tree typeRoot)
focal_class.class_method_signature: TreeUtil.findDefaultPrimaryType(Tree definitions, boolean sns)
focal_class.full_signature: public static String findDefaultPrimaryType(Tree definitions, boolean sns)
focal_class.identifier: findDefaultPrimaryType
focal_class.modifiers: public static
focal_class.parameters: (Tree definitions, boolean sns)
focal_class.return: String
focal_class.signature: String findDefaultPrimaryType(Tree definitions, boolean sns)
focal_class.class_method_signature: TreeUtil.isNodeType(Tree tree, String typeName, Tree typeRoot)
focal_class.full_signature: public static boolean isNodeType(Tree tree, String typeName, Tree typeRoot)
focal_class.identifier: isNodeType
focal_class.modifiers: public static
focal_class.parameters: (Tree tree, String typeName, Tree typeRoot)
focal_class.return: boolean
focal_class.signature: boolean isNodeType(Tree tree, String typeName, Tree typeRoot)
focal_class.class_method_signature: TreeUtil.isReadOnlyTree(@NotNull Tree tree)
focal_class.full_signature: public static boolean isReadOnlyTree(@NotNull Tree tree)
focal_class.identifier: isReadOnlyTree
focal_class.modifiers: public static
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: boolean
focal_class.signature: boolean isReadOnlyTree(@NotNull Tree tree)
focal_method.body: public static String getDefaultChildType(
              Tree typeRoot, Tree parent, String childName) {
          String name = dropIndexFromName(childName);
          boolean sns = !name.equals(childName);
          List<Tree> types = getEffectiveType(parent, typeRoot);
  
          // first look for named node definitions
          for (Tree type : types) {
              Tree definitions = type
                      .getChild(REP_NAMED_CHILD_NODE_DEFINITIONS)
                      .getChild(name);
              String defaultName = findDefaultPrimaryType(definitions, sns);
              if (defaultName != null) {
                  return defaultName;
              }
          }
  
          // then check residual definitions
          for (Tree type : types) {
              Tree definitions = type
                      .getChild(REP_RESIDUAL_CHILD_NODE_DEFINITIONS);
              String defaultName = findDefaultPrimaryType(definitions, sns);
              if (defaultName != null) {
                  return defaultName;
              }
          }
  
          // no matching child node definition found
          return null;
      }
focal_method.class_method_signature: TreeUtil.getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)
focal_method.full_signature: public static String getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)
focal_method.identifier: getDefaultChildType
focal_method.invocations: dropIndexFromName equals getEffectiveType getChild getChild findDefaultPrimaryType getChild findDefaultPrimaryType
focal_method.modifiers: public static
focal_method.parameters: (
              Tree typeRoot, Tree parent, String childName)
focal_method.return: String
focal_method.signature: String getDefaultChildType(
              Tree typeRoot, Tree parent, String childName)