fun addMember( parentType: sun.reflect.generics.tree.BaseType?, memberType: sun.reflect.generics.tree.BaseType? ): DependenceResult? { Preconditions.checkNotNull(parentType, "IE02762: Parent type can not be null.") Preconditions.checkNotNull(memberType, "IE02763: Member type can not be null.") val memberTypeNode: Node = Preconditions.checkNotNull( containedRelationMap.get(memberType), "Type node for member type must exist prior to adding a member." ) val parentNode: Node = Preconditions.checkNotNull( containedRelationMap.get(parentType), "Type node for member parent must exist prior to adding a member" ) if (willCreateCycle(parentType, memberType)) { return DependenceResult(false, ImmutableSet.of<sun.reflect.generics.tree.BaseType>()) } containedRelation.createEdge(memberTypeNode, parentNode) val search = TypeSearch(containedRelationMap.inverse()) search.start(containedRelation, containedRelationMap.get(parentType)) return DependenceResult(true, search.getDependentTypes()) }
Adds a member to the dependence graph and returns the set of base types that are affected by the changed compound type . This method assumes that all base type nodes that correspond to the member base type already exist .