nus-yam/ex-repair huggingface dataset:
Program: 136348
Project: 136348
Buggy source:
/** 
 * Remove the node from the appropriate aggregate node. This does not delete the node, just remove it from aggregate list and takes care of family if needed.
 * @param n
 */
public void removeAggregate(ComponentNode node){
  if ((node instanceof ComplexComponentInterface))   complexRoot.remove(node);
 else   if ((node instanceof SimpleComponentInterface))   simpleRoot.remove(node);
 else   if ((node instanceof ServiceNode || (node instanceof OperationNode)))   serviceRoot.remove(node);
  add(findPreviousVersion(node));
}

Fixed version (ground truth):
/** 
 * Remove the node from the appropriate aggregate node. This does not delete the node, just remove it from aggregate list and takes care of family if needed. Replaces with previous version if found.
 * @param n
 */
public void removeAggregate(ComponentNode node){
  if ((node instanceof ComplexComponentInterface))   complexRoot.remove(node);
 else   if ((node instanceof SimpleComponentInterface))   simpleRoot.remove(node);
 else   if ((node instanceof ServiceNode || (node instanceof OperationNode)))   serviceRoot.remove(node);
  add(findPreviousVersion(node));
}
Program: 136349
Project: 136349
Buggy source:
/** 
 * Unlink this node from its parent and updates family node as needed. If this is a versioned object, it unlinks the verionNode as well. Does not change the TL model. Does not delete the node; caller is responsible to free resources.
 */
public void unlinkNode(){
  if (parent == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  VersionNode vn=null;
  if (parent instanceof VersionNode)   vn=(VersionNode)parent;
  if (!parent.children.remove(this))   LOGGER.debug("String_Node_Str" + getName() + "String_Node_Str"+ parent.getName()+ "String_Node_Str");
  parent.updateFamily();
  parent=null;
  if (vn != null)   vn.unlinkNode();
}

Fixed version (ground truth):
/** 
 * Unlink this node from its parent and updates family node as needed. If this is a versioned object, it unlinks the verionNode as well. Does not change the TL model. Does not delete the node; caller is responsible to free resources.
 */
public void unlinkNode(){
  if (parent == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  VersionNode vn=null;
  if (parent instanceof VersionNode)   vn=(VersionNode)parent;
  if (!parent.children.remove(this))   LOGGER.debug("String_Node_Str" + getName() + "String_Node_Str"+ parent.getName()+ "String_Node_Str");
  parent.updateFamily();
  parent=null;
  if (vn != null) {
    if (this instanceof ComponentNode)     getChain().removeAggregate((ComponentNode)this);
    vn.unlinkNode();
  }
}
Program: 136350
Project: 136350
Buggy source:
public List<Node> getSiblings(){
  final List<Node> siblings=new LinkedList<Node>(parent.getChildren());
  siblings.remove(this);
  return siblings;
}

Fixed version (ground truth):
public List<Node> getSiblings(){
  if (parent == null)   return null;
  final List<Node> siblings=new LinkedList<Node>(parent.getChildren());
  siblings.remove(this);
  return siblings;
}
Program: 136351
Project: 136351
Buggy source:
/** 
 * Swap the replacement for this node. This node is replaced via   {@link #replaceWith()} and removed from parent.Replacement is added to parent.
 * @return Returns false if the swap was not made or the replacement could not be assigned. If false, the swappednode may still be used as a type but may not be in a library.
 */
public void swap(Node replacement){
  if (replacement != null && getLibrary() != null && parent != null) {
    Node thisParent=parent;
    if (!thisParent.children.add(replacement))     return;
    if (getTLModelObject() instanceof LibraryMember)     replacement.getModelObject().addToLibrary(((LibraryMember)this.getTLModelObject()).getOwningLibrary());
    replacement.setLibrary(this.getLibrary());
    replaceWith(replacement);
    replacement.parent=thisParent;
  }
}

Fixed version (ground truth):
/** 
 * Swap the replacement for this node. This node is replaced via   {@link #replaceWith()} and removed from parent.Replacement is added to parent. Note: this node's library is null on return. It can not be deleted.
 * @param replacement - should be in library, named and with all properties.
 * @return ?? void ?? Returns false if the swap was not made or the replacement could not be assigned. If false, theswapped node may still be used as a type but may not be in a library.
 */
public void swap(Node replacement){
  if (replacement != null && getLibrary() != null && parent != null) {
    Node thisParent=parent;
    if (!thisParent.children.add(replacement)) {
      LOGGER.warn("String_Node_Str");
      return;
    }
    if (getTLModelObject() instanceof LibraryMember) {
      if (((LibraryMember)replacement.getTLModelObject()).getOwningLibrary() != ((LibraryMember)getTLModelObject()).getOwningLibrary()) {
        LOGGER.debug("String_Node_Str");
        replacement.getModelObject().addToLibrary(((LibraryMember)this.getTLModelObject()).getOwningLibrary());
      }
 else       LOGGER.debug("String_Node_Str");
    }
 else     LOGGER.error("String_Node_Str");
    replacement.setLibrary(this.getLibrary());
    replaceWith(replacement);
    replacement.parent=thisParent;
  }
 else   LOGGER.warn("String_Node_Str");
}
Program: 136352
Project: 136352
Buggy source:
@Override public void delete(){
  if (isDeleteable()) {
    if (getLibrary() != null && getLibrary().isInChain())     getLibrary().getChain().removeAggregate((ComponentNode)this);
    NodeVisitor visitor=new NodeVisitors().new deleteVisitor();
    this.visitAllNodes(visitor);
  }
}

Fixed version (ground truth):
@Override public void delete(){
  if (isDeleteable()) {
    if (getLibrary() != null && getLibrary().isInChain())     getLibrary().getChain().removeAggregate((ComponentNode)this);
    NodeVisitor visitor=new NodeVisitors().new deleteVisitor();
    this.visitAllNodes(visitor);
  }
 else   if (!(this instanceof VersionNode) && (!(this instanceof FacetNode)) && !(this instanceof SimpleAttributeNode))   LOGGER.warn(this + "String_Node_Str" + isDeleteable());
}
Program: 136353
Project: 136353
Buggy source:
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else {
getChildren().add(node);
}
return toBeAdded;
}

Fixed version (ground truth):
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (!n.isFamily() && n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else {
getChildren().add(node);
}
return toBeAdded;
}
Program: 136354
Project: 136354
Buggy source:
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n.getVersionNode() == null || n.isInHead();
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n instanceof BusinessObjectNode ? n.isEditable() && n.isNewToChain() : false;
}
Program: 136355
Project: 136355
Buggy source:
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n.getVersionNode() == null || n.isInHead();
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n instanceof BusinessObjectNode ? n.isEditable() && n.isNewToChain() : false;
}
Program: 136356
Project: 136356
Buggy source:
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else getChildren().add(node);
return toBeAdded;
}

Fixed version (ground truth):
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else getChildren().add(node);
return toBeAdded;
}
Program: 136357
Project: 136357
Buggy source:
@Override public List<Node> getNavChildren(){
  if (type.equals(AggregateType.Versions)) {
    return super.getChildren();
  }
 else {
    ArrayList<Node> kids=new ArrayList<Node>();
    for (    Node child : getChildren()) {
      if (child instanceof VersionNode)       kids.add(((VersionNode)child).getHead());
    }
    return kids;
  }
}

Fixed version (ground truth):
@Override public List<Node> getNavChildren(){
  if (type.equals(AggregateType.Versions)) {
    return super.getChildren();
  }
 else {
    ArrayList<Node> kids=new ArrayList<Node>();
    for (    Node child : getChildren()) {
      if (child instanceof VersionNode)       kids.add(((VersionNode)child).getNewestVersion());
    }
    return kids;
  }
}
Program: 136358
Project: 136358
Buggy source:
/** 
 * Find the "latest" previous version of the node.
 * @param node
 */
private ComponentNode findPreviousVersion(ComponentNode node){
  ComponentNode n, vn=null;
  for (  Node ln : versions.getChildren()) {
    n=(ComponentNode)ln.findNodeByName(node.getName());
    if (vn == null && n != node)     vn=n;
 else     if (n != null && n != node)     if (isLaterVersion(n,vn))     vn=n;
  }
  return vn;
}

Fixed version (ground truth):
/** 
 * Find the "latest" previous version of the node.
 * @param node
 */
private ComponentNode findPreviousVersion(ComponentNode node){
  return node.getVersionNode() != null ? node.getVersionNode().getPreviousVersion() : null;
}
Program: 136359
Project: 136359
Buggy source:
/** 
 * @return True if this node is not in a chain, OR it is in the latest library of the chain ANDnot in a previous version.
 */
public boolean isNewToChain(){
  if (getChain() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  return false;
}

Fixed version (ground truth):
/** 
 * Is the object new to the chain. The object is represented by one or more nodes with the same name within the chain.
 * @return True if this node is not in a chain, OR it is in the latest library of the chain ANDnot in a previous version. Note that node may or may not be editable.
 */
public boolean isNewToChain(){
  if (getChain() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  return getVersionNode().getPreviousVersion() == null ? true : false;
}
Program: 136360
Project: 136360
Buggy source:
/** 
 * Creates the version node and inserts into the library before the passed node.
 */
public VersionNode(ComponentNode node){
  super(node.getTLModelObject());
  getChildren().add(node);
  head=node;
  node.setVersionNode(this);
  if (node.getLibrary() == null)   throw new IllegalStateException("String_Node_Str");
  setLibrary(node.getLibrary());
  if (node.getParent() == null)   throw new IllegalStateException("String_Node_Str" + node + "String_Node_Str");
  setParent(node.getParent());
  node.getParent().getChildren().remove(node);
  node.getParent().getChildren().add(this);
  node.setParent(this);
}

Fixed version (ground truth):
/** 
 * Creates the version node and inserts into the library before the passed node. This does NOT place this node into the Aggregates. Set previous version to null (new to chain).
 */
public VersionNode(ComponentNode node){
  super(node.getTLModelObject());
  getChildren().add(node);
  head=node;
  prevVersion=null;
  node.setVersionNode(this);
  if (node.getLibrary() == null)   throw new IllegalStateException("String_Node_Str");
  setLibrary(node.getLibrary());
  if (node.getParent() == null)   throw new IllegalStateException("String_Node_Str" + node + "String_Node_Str");
  setParent(node.getParent());
  node.getParent().getChildren().remove(node);
  node.getParent().getChildren().add(this);
  node.setParent(this);
}
Program: 136361
Project: 136361
Buggy source:
private boolean canAdd(Node node){
  if (node == null || node.getParent() == null)   return false;
  if (node.isDeleted() || !node.isEditable())   return false;
  if (node instanceof ProjectNode)   return false;
  if (node instanceof LibraryChainNode)   return false;
  if (node instanceof OperationNode)   return false;
  if (node.isBusinessObject() || node.isCoreObject() || node.isExtensionPointFacet()) {
    return true;
  }
  if (node.isValueWithAttributes() || node.isEnumeration()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL) || node.getEditStatus().equals(NodeEditStatus.MINOR))     return true;
 else     return false;
  }
  if (node.isMessage()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL))     return true;
 else     return false;
  }
  if (node instanceof ServiceNode)   if (node.getEditStatus().equals(NodeEditStatus.FULL))   return true;
 else   return false;
  if (node.isSimpleFacet())   return false;
  if (node.isListFacet())   return false;
  if (node.isRoleFacet() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isFacet())   return canAdd(node.getParent());
  if (node instanceof SimpleAttributeNode)   return false;
  if (node.isRoleProperty() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isProperty())   if (node == node.getOwningComponent())   return false;
 else   return canAdd(node.getOwningComponent());
  return false;
}

Fixed version (ground truth):
private boolean canAdd(Node node){
  if (node == null || node.getParent() == null)   return false;
  if (node.isDeleted() || !node.isEditable())   return false;
  if (node instanceof ProjectNode)   return false;
  if (node instanceof LibraryChainNode)   return false;
  if (node instanceof OperationNode)   return false;
  if (node instanceof ExtensionPointNode || node instanceof VWA_Node) {
    return node.isNewToChain();
  }
  if (node.isBusinessObject() || node.isCoreObject() || node.isExtensionPointFacet()) {
    return true;
  }
  if (node.isValueWithAttributes() || node.isEnumeration()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL) || node.getEditStatus().equals(NodeEditStatus.MINOR))     return true;
 else     return false;
  }
  if (node.isMessage()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL))     return true;
 else     return false;
  }
  if (node instanceof ServiceNode)   if (node.getEditStatus().equals(NodeEditStatus.FULL))   return true;
 else   return false;
  if (node.isSimpleFacet())   return false;
  if (node.isListFacet())   return false;
  if (node.isRoleFacet() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isFacet())   return canAdd(node.getParent());
  if (node instanceof SimpleAttributeNode)   return false;
  if (node.isRoleProperty() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isProperty())   if (node == node.getOwningComponent())   return false;
 else   return canAdd(node.getOwningComponent());
  return false;
}
Program: 136362
Project: 136362
Buggy source:
@Override public void doubleClick(DoubleClickEvent dcEvent){
  Node node=null;
  if (dcEvent.getSelection() instanceof IStructuredSelection) {
    IStructuredSelection ss=(IStructuredSelection)dcEvent.getSelection();
    if (ss.getFirstElement() instanceof Node)     node=(Node)ss.getFirstElement();
  }
  if (node instanceof TypeNode)   node=node.getParent();
 else   if (node instanceof VersionNode)   node=(((VersionNode)node).getHead());
  if (node != null) {
    setCurrentNode(node);
    select(node);
    navigatorMenus.doubleClickNotification();
  }
}

Fixed version (ground truth):
@Override public void doubleClick(DoubleClickEvent dcEvent){
  Node node=null;
  if (dcEvent.getSelection() instanceof IStructuredSelection) {
    IStructuredSelection ss=(IStructuredSelection)dcEvent.getSelection();
    if (ss.getFirstElement() instanceof Node)     node=(Node)ss.getFirstElement();
  }
  if (node instanceof TypeNode)   node=node.getParent();
 else   if (node instanceof VersionNode)   node=(((VersionNode)node).getNewestVersion());
  if (node != null) {
    setCurrentNode(node);
    select(node);
    navigatorMenus.doubleClickNotification();
  }
}
Program: 136363
Project: 136363
Buggy source:
/** 
 * Locates the source node for the selected finding in the library navigation view.
 */
private void selectFindingSource(ValidationFinding finding){
  Validatable findingSource=getNodeMappableFindingSource(finding);
  String validationIdentity=findingSource.getValidationIdentity();
  if (validationIdentity == null)   return;
  Node n=NodeFinders.findNodeByValidationIentity(validationIdentity);
  if (n == null)   return;
  LOGGER.debug("String_Node_Str" + validationIdentity);
  int e=finding.getMessageKey().lastIndexOf("String_Node_Str");
  String error=finding.getMessageKey().substring(++e);
  LOGGER.debug("String_Node_Str" + error);
  if (error.equals(TLValidationBuilder.UNRESOLVED_NAMED_ENTITY_REFERENCE)) {
    OtmEventData wd=new OtmEventData();
    wd.setBusinessEvent(OtmActions.typeSelector());
    wd.setNode(null);
    wd.setNodeList(findMatching(finding,error));
    if (wd.getNodeList() != null && !wd.getNodeList().isEmpty() && wd.getNodeList().get(0).isEditable())     otmActions.doEvent(wd);
    validateNode((Node)currentNode);
  }
  LOGGER.debug("String_Node_Str" + n + "String_Node_Str"+ validationIdentity);
  mc.selectNavigatorNodeAndRefresh(n);
}

Fixed version (ground truth):
/** 
 * Locates the source node for the selected finding in the library navigation view.
 */
private void selectFindingSource(ValidationFinding finding){
  Validatable findingSource=getNodeMappableFindingSource(finding);
  String validationIdentity=findingSource.getValidationIdentity();
  if (validationIdentity == null)   return;
  Node n=NodeFinders.findNodeByValidationIentity(validationIdentity);
  if (n == null)   return;
  int e=finding.getMessageKey().lastIndexOf("String_Node_Str");
  String error=finding.getMessageKey().substring(++e);
  if (error.equals(TLValidationBuilder.UNRESOLVED_NAMED_ENTITY_REFERENCE)) {
    OtmEventData wd=new OtmEventData();
    wd.setBusinessEvent(OtmActions.typeSelector());
    wd.setNode(null);
    wd.setNodeList(findMatching(finding,error));
    Node target=null;
    if (wd.getNodeList() != null && !wd.getNodeList().isEmpty())     target=wd.getNodeList().get(0);
    if (target != null)     otmActions.doEvent(wd);
    validateNode((Node)currentNode);
  }
  mc.selectNavigatorNodeAndRefresh(n);
}
Program: 136365
Project: 136365
Buggy source:
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  projectItem=pi;
  updateLibraryStatus();
}

Fixed version (ground truth):
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  projectItem=pi;
  updateLibraryStatus();
}
Program: 136366
Project: 136366
Buggy source:
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    if (node instanceof PropertyNode)     navChildren.addAll(node.getNavChildren());
 else     if (node instanceof VersionAggregateNode) {
      navChildren.addAll(node.getNavChildren());
    }
 else {
      navChildren.addAll(node.getChildren());
      if (node.isNamedType())       navChildren.add(node.getTypeClass().getTypeTreeNode());
      navChildren.addAll(node.getInheritedChildren());
      if (node instanceof ModelNode) {
        if (!navChildren.contains(ModelNode.getUnassignedNode())) {
          navChildren.add(ModelNode.getUnassignedNode());
        }
      }
    }
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   if (element instanceof TypeNode) {
    ((TypeNode)element).getChildren();
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
  return null;
}

Fixed version (ground truth):
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    if (node instanceof PropertyNode || node instanceof VersionAggregateNode || node instanceof VersionNode) {
      navChildren.addAll(node.getNavChildren());
    }
 else {
      navChildren.addAll(node.getChildren());
      if (node.isNamedType())       navChildren.add(node.getTypeClass().getTypeTreeNode());
      navChildren.addAll(node.getInheritedChildren());
      if (node instanceof ModelNode) {
        if (!navChildren.contains(ModelNode.getUnassignedNode())) {
          navChildren.add(ModelNode.getUnassignedNode());
        }
      }
    }
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   if (element instanceof TypeNode) {
    ((TypeNode)element).getChildren();
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
  return null;
}
Program: 136367
Project: 136367
Buggy source:
@Test public void testMajor(){
  Assert.assertTrue(chain.isEditable());
  LibraryNode newMajor=rc.createMajorVersion(chain.getHead());
  TotalDescendents=TotalDescendents - 2;
  ActiveComplex--;
  Assert.assertFalse(chain.isEditable());
  LibraryChainNode newChain=newMajor.getChain();
  BusinessObjectNode majorBO=ml.addBusinessObjectToLibrary(newMajor,"String_Node_Str");
  checkCounts(newChain);
  for (  Node n : newMajor.getDescendants_NamedTypes()) {
    if (n.getName().equals(bo.getName()))     bo=(BusinessObjectNode)n;
    if (n.getName().equals(co.getName()))     co=(CoreObjectNode)n;
  }
  Assert.assertTrue(majorBO.isDeleteable());
  Assert.assertTrue(bo.isDeleteable());
  Assert.assertTrue(co.isDeleteable());
}

Fixed version (ground truth):
@Test public void testMajor(){
  Assert.assertTrue(chain.isEditable());
  LibraryNode newMajor=rc.createMajorVersion(chain.getHead());
  TotalDescendents=TotalDescendents - 3;
  ActiveComplex--;
  Assert.assertFalse(chain.isEditable());
  LibraryChainNode newChain=newMajor.getChain();
  BusinessObjectNode majorBO=ml.addBusinessObjectToLibrary(newMajor,"String_Node_Str");
  checkCounts(newChain);
  for (  Node n : newMajor.getDescendants_NamedTypes()) {
    if (n.getName().equals(bo.getName()))     bo=(BusinessObjectNode)n;
    if (n.getName().equals(co.getName()))     co=(CoreObjectNode)n;
  }
  Assert.assertTrue(majorBO.isDeleteable());
  Assert.assertTrue(bo.isDeleteable());
  Assert.assertTrue(co.isDeleteable());
}
Program: 136369
Project: 136369
Buggy source:
@Test public void testFacets(){
  int facetCount=bo.getChildren().size();
  bo.addFacet("String_Node_Str","String_Node_Str",TLFacetType.CUSTOM);
  Assert.assertEquals(facetCount,bo.getChildren().size());
  nbo=(BusinessObjectNode)bo.createMinorVersionComponent();
  MinorComplex+=1;
  nbo.isInHead();
  List<String> contextIDs=minorLibrary.getContextIds();
  Assert.assertFalse(contextIDs.isEmpty());
  nbo.addFacet("String_Node_Str",contextIDs.get(0),TLFacetType.CUSTOM);
  Assert.assertEquals(4,nbo.getChildren().size());
  Assert.assertEquals(MinorComplex,minorLibrary.getDescendants_NamedTypes().size());
  Assert.assertTrue(chain.isValid());
  nbo.delete();
  MinorComplex-=1;
  checkCounts(chain);
}

Fixed version (ground truth):
@Test public void testFacets(){
  int facetCount=bo.getChildren().size();
  bo.addFacet("String_Node_Str","String_Node_Str",TLFacetType.CUSTOM);
  Assert.assertEquals(facetCount,bo.getChildren().size());
  nbo=(BusinessObjectNode)bo.createMinorVersionComponent();
  MinorComplex+=1;
  nbo.isInHead();
  List<String> contextIDs=minorLibrary.getContextIds();
  Assert.assertFalse(contextIDs.isEmpty());
  nbo.addFacet("String_Node_Str",contextIDs.get(0),TLFacetType.CUSTOM);
  Assert.assertEquals(4,nbo.getChildren().size());
  Assert.assertEquals(MinorComplex + 1,minorLibrary.getDescendants_NamedTypes().size());
  Assert.assertTrue(chain.isValid());
  nbo.delete();
  MinorComplex-=1;
  checkCounts(chain);
}
Program: 136371
Project: 136371
Buggy source:
public boolean hasService(){
  return serviceRoot != null;
}

Fixed version (ground truth):
public boolean hasService(){
  return !serviceRoot.getChildren().isEmpty();
}
Program: 136372
Project: 136372
Buggy source:
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  projectItem=pi;
  updateLibraryStatus();
}

Fixed version (ground truth):
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  ServiceNode serviceNode=getService();
  if (serviceNode != null) {
    chain.add(serviceNode);
  }
  projectItem=pi;
  updateLibraryStatus();
}
Program: 136373
Project: 136373
Buggy source:
/** 
 * @return true only if this object is in the version head library. false if not or unmanaged.
 */
public boolean isInHead(){
  if (getOwningComponent().versionNode == null)   return false;
  return getChain().getHead().getDescendants_NamedTypes().contains(getOwningComponent());
}

Fixed version (ground truth):
/** 
 * @return true only if this object is in the version head library. false if not or unmanaged.
 */
public boolean isInHead(){
  Node owner=getOwningComponent();
  if (owner instanceof OperationNode) {
    owner=owner.getOwningComponent();
  }
  if (owner == null || owner.versionNode == null)   return false;
  return getChain().getHead().getDescendants_NamedTypes().contains(owner);
}
Program: 136374
Project: 136374
Buggy source:
public boolean hasService(){
  return serviceRoot != null;
}

Fixed version (ground truth):
public boolean hasService(){
  return !serviceRoot.getChildren().isEmpty();
}
Program: 136375
Project: 136375
Buggy source:
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  projectItem=pi;
  updateLibraryStatus();
}

Fixed version (ground truth):
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  ServiceNode serviceNode=getService();
  if (serviceNode != null) {
    chain.add(serviceNode);
  }
  projectItem=pi;
  updateLibraryStatus();
}
Program: 136376
Project: 136376
Buggy source:
/** 
 * @return true only if this object is in the version head library. false if not or unmanaged.
 */
public boolean isInHead(){
  if (getOwningComponent().versionNode == null)   return false;
  return getChain().getHead().getDescendants_NamedTypes().contains(getOwningComponent());
}

Fixed version (ground truth):
/** 
 * @return true only if this object is in the version head library. false if not or unmanaged.
 */
public boolean isInHead(){
  Node owner=getOwningComponent();
  if (owner instanceof OperationNode) {
    owner=owner.getOwningComponent();
  }
  if (owner == null || owner.versionNode == null)   return false;
  return getChain().getHead().getDescendants_NamedTypes().contains(owner);
}
Program: 136377
Project: 136377
Buggy source:
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n.getVersionNode() == null || n.isInHead();
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n instanceof BusinessObjectNode ? n.isEditable() && n.isNewToChain() : false;
}
Program: 136378
Project: 136378
Buggy source:
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n.getVersionNode() == null || n.isInHead();
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=mc.getCurrentNode_NavigatorView().getOwningComponent();
  return n instanceof BusinessObjectNode ? n.isEditable() && n.isNewToChain() : false;
}
Program: 136379
Project: 136379
Buggy source:
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else getChildren().add(node);
return toBeAdded;
}

Fixed version (ground truth):
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else getChildren().add(node);
return toBeAdded;
}
Program: 136380
Project: 136380
Buggy source:
@Override public List<Node> getNavChildren(){
  if (type.equals(AggregateType.Versions)) {
    return super.getChildren();
  }
 else {
    ArrayList<Node> kids=new ArrayList<Node>();
    for (    Node child : getChildren()) {
      if (child instanceof VersionNode)       kids.add(((VersionNode)child).getHead());
    }
    return kids;
  }
}

Fixed version (ground truth):
@Override public List<Node> getNavChildren(){
  if (type.equals(AggregateType.Versions)) {
    return super.getChildren();
  }
 else {
    ArrayList<Node> kids=new ArrayList<Node>();
    for (    Node child : getChildren()) {
      if (child instanceof VersionNode)       kids.add(((VersionNode)child).getNewestVersion());
    }
    return kids;
  }
}
Program: 136381
Project: 136381
Buggy source:
/** 
 * Find the "latest" previous version of the node.
 * @param node
 */
private ComponentNode findPreviousVersion(ComponentNode node){
  ComponentNode n, vn=null;
  for (  Node ln : versions.getChildren()) {
    n=(ComponentNode)ln.findNodeByName(node.getName());
    if (vn == null && n != node)     vn=n;
 else     if (n != null && n != node)     if (isLaterVersion(n,vn))     vn=n;
  }
  return vn;
}

Fixed version (ground truth):
/** 
 * Find the "latest" previous version of the node.
 * @param node
 */
private ComponentNode findPreviousVersion(ComponentNode node){
  return node.getVersionNode() != null ? node.getVersionNode().getPreviousVersion() : null;
}
Program: 136382
Project: 136382
Buggy source:
/** 
 * @return True if this node is not in a chain, OR it is in the latest library of the chain ANDnot in a previous version.
 */
public boolean isNewToChain(){
  if (getChain() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  return false;
}

Fixed version (ground truth):
/** 
 * Is the object new to the chain. The object is represented by one or more nodes with the same name within the chain.
 * @return True if this node is not in a chain, OR it is in the latest library of the chain ANDnot in a previous version. Note that node may or may not be editable.
 */
public boolean isNewToChain(){
  if (getChain() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  return getVersionNode().getPreviousVersion() == null ? true : false;
}
Program: 136383
Project: 136383
Buggy source:
/** 
 * Creates the version node and inserts into the library before the passed node.
 */
public VersionNode(ComponentNode node){
  super(node.getTLModelObject());
  getChildren().add(node);
  head=node;
  node.setVersionNode(this);
  if (node.getLibrary() == null)   throw new IllegalStateException("String_Node_Str");
  setLibrary(node.getLibrary());
  if (node.getParent() == null)   throw new IllegalStateException("String_Node_Str" + node + "String_Node_Str");
  setParent(node.getParent());
  node.getParent().getChildren().remove(node);
  node.getParent().getChildren().add(this);
  node.setParent(this);
}

Fixed version (ground truth):
/** 
 * Creates the version node and inserts into the library before the passed node. This does NOT place this node into the Aggregates. Set previous version to null (new to chain).
 */
public VersionNode(ComponentNode node){
  super(node.getTLModelObject());
  getChildren().add(node);
  head=node;
  prevVersion=null;
  node.setVersionNode(this);
  if (node.getLibrary() == null)   throw new IllegalStateException("String_Node_Str");
  setLibrary(node.getLibrary());
  if (node.getParent() == null)   throw new IllegalStateException("String_Node_Str" + node + "String_Node_Str");
  setParent(node.getParent());
  node.getParent().getChildren().remove(node);
  node.getParent().getChildren().add(this);
  node.setParent(this);
}
Program: 136384
Project: 136384
Buggy source:
private boolean canAdd(Node node){
  if (node == null || node.getParent() == null)   return false;
  if (node.isDeleted() || !node.isEditable())   return false;
  if (node instanceof ProjectNode)   return false;
  if (node instanceof LibraryChainNode)   return false;
  if (node instanceof OperationNode)   return false;
  if (node.isBusinessObject() || node.isCoreObject() || node.isExtensionPointFacet()) {
    return true;
  }
  if (node.isValueWithAttributes() || node.isEnumeration()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL) || node.getEditStatus().equals(NodeEditStatus.MINOR))     return true;
 else     return false;
  }
  if (node.isMessage()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL))     return true;
 else     return false;
  }
  if (node instanceof ServiceNode)   if (node.getEditStatus().equals(NodeEditStatus.FULL))   return true;
 else   return false;
  if (node.isSimpleFacet())   return false;
  if (node.isListFacet())   return false;
  if (node.isRoleFacet() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isFacet())   return canAdd(node.getParent());
  if (node instanceof SimpleAttributeNode)   return false;
  if (node.isRoleProperty() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isProperty())   if (node == node.getOwningComponent())   return false;
 else   return canAdd(node.getOwningComponent());
  return false;
}

Fixed version (ground truth):
private boolean canAdd(Node node){
  if (node == null || node.getParent() == null)   return false;
  if (node.isDeleted() || !node.isEditable())   return false;
  if (node instanceof ProjectNode)   return false;
  if (node instanceof LibraryChainNode)   return false;
  if (node instanceof OperationNode)   return false;
  if (node instanceof ExtensionPointNode || node instanceof VWA_Node) {
    return node.isNewToChain();
  }
  if (node.isBusinessObject() || node.isCoreObject() || node.isExtensionPointFacet()) {
    return true;
  }
  if (node.isValueWithAttributes() || node.isEnumeration()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL) || node.getEditStatus().equals(NodeEditStatus.MINOR))     return true;
 else     return false;
  }
  if (node.isMessage()) {
    if (node.getEditStatus().equals(NodeEditStatus.FULL))     return true;
 else     return false;
  }
  if (node instanceof ServiceNode)   if (node.getEditStatus().equals(NodeEditStatus.FULL))   return true;
 else   return false;
  if (node.isSimpleFacet())   return false;
  if (node.isListFacet())   return false;
  if (node.isRoleFacet() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isFacet())   return canAdd(node.getParent());
  if (node instanceof SimpleAttributeNode)   return false;
  if (node.isRoleProperty() && !node.getEditStatus().equals(NodeEditStatus.FULL))   return false;
  if (node.isProperty())   if (node == node.getOwningComponent())   return false;
 else   return canAdd(node.getOwningComponent());
  return false;
}
Program: 136385
Project: 136385
Buggy source:
@Override public void doubleClick(DoubleClickEvent dcEvent){
  Node node=null;
  if (dcEvent.getSelection() instanceof IStructuredSelection) {
    IStructuredSelection ss=(IStructuredSelection)dcEvent.getSelection();
    if (ss.getFirstElement() instanceof Node)     node=(Node)ss.getFirstElement();
  }
  if (node instanceof TypeNode)   node=node.getParent();
 else   if (node instanceof VersionNode)   node=(((VersionNode)node).getHead());
  if (node != null) {
    setCurrentNode(node);
    select(node);
    navigatorMenus.doubleClickNotification();
  }
}

Fixed version (ground truth):
@Override public void doubleClick(DoubleClickEvent dcEvent){
  Node node=null;
  if (dcEvent.getSelection() instanceof IStructuredSelection) {
    IStructuredSelection ss=(IStructuredSelection)dcEvent.getSelection();
    if (ss.getFirstElement() instanceof Node)     node=(Node)ss.getFirstElement();
  }
  if (node instanceof TypeNode)   node=node.getParent();
 else   if (node instanceof VersionNode)   node=(((VersionNode)node).getNewestVersion());
  if (node != null) {
    setCurrentNode(node);
    select(node);
    navigatorMenus.doubleClickNotification();
  }
}
Program: 136386
Project: 136386
Buggy source:
/** 
 * Locates the source node for the selected finding in the library navigation view.
 */
private void selectFindingSource(ValidationFinding finding){
  Validatable findingSource=getNodeMappableFindingSource(finding);
  String validationIdentity=findingSource.getValidationIdentity();
  if (validationIdentity == null)   return;
  Node n=NodeFinders.findNodeByValidationIentity(validationIdentity);
  if (n == null)   return;
  LOGGER.debug("String_Node_Str" + validationIdentity);
  int e=finding.getMessageKey().lastIndexOf("String_Node_Str");
  String error=finding.getMessageKey().substring(++e);
  LOGGER.debug("String_Node_Str" + error);
  if (error.equals(TLValidationBuilder.UNRESOLVED_NAMED_ENTITY_REFERENCE)) {
    OtmEventData wd=new OtmEventData();
    wd.setBusinessEvent(OtmActions.typeSelector());
    wd.setNode(null);
    wd.setNodeList(findMatching(finding,error));
    if (wd.getNodeList() != null && !wd.getNodeList().isEmpty() && wd.getNodeList().get(0).isEditable())     otmActions.doEvent(wd);
    validateNode((Node)currentNode);
  }
  LOGGER.debug("String_Node_Str" + n + "String_Node_Str"+ validationIdentity);
  mc.selectNavigatorNodeAndRefresh(n);
}

Fixed version (ground truth):
/** 
 * Locates the source node for the selected finding in the library navigation view.
 */
private void selectFindingSource(ValidationFinding finding){
  Validatable findingSource=getNodeMappableFindingSource(finding);
  String validationIdentity=findingSource.getValidationIdentity();
  if (validationIdentity == null)   return;
  Node n=NodeFinders.findNodeByValidationIentity(validationIdentity);
  if (n == null)   return;
  int e=finding.getMessageKey().lastIndexOf("String_Node_Str");
  String error=finding.getMessageKey().substring(++e);
  if (error.equals(TLValidationBuilder.UNRESOLVED_NAMED_ENTITY_REFERENCE)) {
    OtmEventData wd=new OtmEventData();
    wd.setBusinessEvent(OtmActions.typeSelector());
    wd.setNode(null);
    wd.setNodeList(findMatching(finding,error));
    Node target=null;
    if (wd.getNodeList() != null && !wd.getNodeList().isEmpty())     target=wd.getNodeList().get(0);
    if (target != null)     otmActions.doEvent(wd);
    validateNode((Node)currentNode);
  }
  mc.selectNavigatorNodeAndRefresh(n);
}
Program: 136388
Project: 136388
Buggy source:
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  projectItem=pi;
  updateLibraryStatus();
}

Fixed version (ground truth):
public LibraryNode(ProjectItem pi,LibraryChainNode chain){
  this(pi.getContent(),chain.getVersions());
  for (  Node members : getDescendentsNamedTypes()) {
    if (members instanceof ComponentNode) {
      chain.add((ComponentNode)members);
    }
  }
  projectItem=pi;
  updateLibraryStatus();
}
Program: 136389
Project: 136389
Buggy source:
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    if (node instanceof PropertyNode)     navChildren.addAll(node.getNavChildren());
 else     if (node instanceof VersionAggregateNode) {
      navChildren.addAll(node.getNavChildren());
    }
 else {
      navChildren.addAll(node.getChildren());
      if (node.isNamedType())       navChildren.add(node.getTypeClass().getTypeTreeNode());
      navChildren.addAll(node.getInheritedChildren());
      if (node instanceof ModelNode) {
        if (!navChildren.contains(ModelNode.getUnassignedNode())) {
          navChildren.add(ModelNode.getUnassignedNode());
        }
      }
    }
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   if (element instanceof TypeNode) {
    ((TypeNode)element).getChildren();
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
  return null;
}

Fixed version (ground truth):
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    if (node instanceof PropertyNode || node instanceof VersionAggregateNode || node instanceof VersionNode) {
      navChildren.addAll(node.getNavChildren());
    }
 else {
      navChildren.addAll(node.getChildren());
      if (node.isNamedType())       navChildren.add(node.getTypeClass().getTypeTreeNode());
      navChildren.addAll(node.getInheritedChildren());
      if (node instanceof ModelNode) {
        if (!navChildren.contains(ModelNode.getUnassignedNode())) {
          navChildren.add(ModelNode.getUnassignedNode());
        }
      }
    }
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   if (element instanceof TypeNode) {
    ((TypeNode)element).getChildren();
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
  return null;
}