Program: 135851
Project: 135851
Buggy source:
/** 
 * Get the External NodeConnectors of the network, which are the NodeConnectors connected to hosts.
 * @return  The list of external node connectors.
 */
public void readInventory(){
  if (controllerSwitchConnectors.size() > 0 || switchNodeConnectors.size() > 0) {
    return;
  }
  InstanceIdentifier.InstanceIdentifierBuilder<Nodes> nodesInsIdBuilder=InstanceIdentifier.<Nodes>builder(Nodes.class);
  Nodes nodes=(Nodes)dataService.readOperationalData(nodesInsIdBuilder.toInstance());
  if (nodes != null) {
    for (    Node node : nodes.getNode()) {
      ArrayList<NodeConnectorRef> nodeConnectorRefs=new ArrayList<NodeConnectorRef>();
      List<NodeConnector> nodeConnectors=node.getNodeConnector();
      if (nodeConnectors != null) {
        for (        NodeConnector nodeConnector : nodeConnectors) {
          NodeConnectorRef ncRef=new NodeConnectorRef(InstanceIdentifier.<Nodes>builder(Nodes.class).<Node,NodeKey>child(Node.class,node.getKey()).<NodeConnector,NodeConnectorKey>child(NodeConnector.class,nodeConnector.getKey()).toInstance());
          if (nodeConnector.getKey().toString().contains("String_Node_Str")) {
            controllerSwitchConnectors.put(node.getId().getValue(),ncRef);
          }
 else {
            nodeConnectorRefs.add(ncRef);
          }
        }
      }
      switchNodeConnectors.put(node.getId().getValue(),nodeConnectorRefs);
    }
  }
}

Fixed version (ground truth):
/** 
 * Get the External NodeConnectors of the network, which are the NodeConnectors connected to hosts.
 * @return The list of external node connectors.
 */
public void readInventory(){
  if (controllerSwitchConnectors.size() > 0 || switchNodeConnectors.size() > 0) {
    return;
  }
  InstanceIdentifier.InstanceIdentifierBuilder<Nodes> nodesInsIdBuilder=InstanceIdentifier.<Nodes>builder(Nodes.class);
  Nodes nodes=null;
  ReadOnlyTransaction readOnlyTransaction=dataService.newReadOnlyTransaction();
  try {
    Optional<DataObject> dataObjectOptional=null;
    dataObjectOptional=readOnlyTransaction.read(LogicalDatastoreType.OPERATIONAL,nodesInsIdBuilder.toInstance()).get();
    if (dataObjectOptional.isPresent())     nodes=(Nodes)dataObjectOptional.get();
  }
 catch (  InterruptedException e) {
    _logger.error("String_Node_Str");
    throw new RuntimeException("String_Node_Str",e);
  }
catch (  ExecutionException e) {
    _logger.error("String_Node_Str");
    throw new RuntimeException("String_Node_Str",e);
  }
  if (nodes != null) {
    for (    Node node : nodes.getNode()) {
      ArrayList<NodeConnectorRef> nodeConnectorRefs=new ArrayList<NodeConnectorRef>();
      List<NodeConnector> nodeConnectors=node.getNodeConnector();
      if (nodeConnectors != null) {
        for (        NodeConnector nodeConnector : nodeConnectors) {
          NodeConnectorRef ncRef=new NodeConnectorRef(InstanceIdentifier.<Nodes>builder(Nodes.class).<Node,NodeKey>child(Node.class,node.getKey()).<NodeConnector,NodeConnectorKey>child(NodeConnector.class,nodeConnector.getKey()).toInstance());
          if (nodeConnector.getKey().toString().contains("String_Node_Str")) {
            controllerSwitchConnectors.put(node.getId().getValue(),ncRef);
          }
 else {
            nodeConnectorRefs.add(ncRef);
          }
        }
      }
      switchNodeConnectors.put(node.getId().getValue(),nodeConnectorRefs);
    }
  }
}