Program: 15487
Project: 15487
Buggy source:
@NotNull public Map<String,ContainerService> getLocalServiceMap(PsiElement psiElement){
  Map<String,ContainerService> services=new HashMap<String,ContainerService>();
  if (!(psiElement.getContainingFile().getFirstChild() instanceof YAMLDocument)) {
    return services;
  }
  YAMLDocument yamlDocument=(YAMLDocument)psiElement.getContainingFile().getFirstChild();
  YAMLKeyValue[] yamlKeys=PsiTreeUtil.getChildrenOfType(yamlDocument,YAMLKeyValue.class);
  if (yamlKeys == null) {
    return services;
  }
  for (  YAMLKeyValue yamlKeyValue : yamlKeys) {
    String yamlConfigKey=yamlKeyValue.getName();
    if (yamlConfigKey != null && yamlConfigKey.equals("String_Node_Str")) {
      YAMLKeyValue yamlServices[]=PsiTreeUtil.getChildrenOfType(yamlKeyValue.getValue(),YAMLKeyValue.class);
      if (yamlServices != null) {
        for (        YAMLKeyValue yamlServiceKeyValue : yamlServices) {
          String serviceName=yamlServiceKeyValue.getName();
          String serviceClass=null;
          boolean isPrivate=false;
          YAMLKeyValue[] yamlServiceKeys=PsiTreeUtil.getChildrenOfType(yamlServiceKeyValue.getValue(),YAMLKeyValue.class);
          if (yamlServiceKeys != null) {
            String serviceClassName=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceClassName != null) {
              serviceClass=PsiElementUtils.trimQuote(serviceClassName);
              if (StringUtils.isBlank(serviceClass)) {
                serviceClass=null;
              }
            }
            String serviceIsPublic=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceIsPublic != null && serviceIsPublic.equals("String_Node_Str")) {
              isPrivate=true;
            }
            String serviceAlias=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceAlias != null && serviceAlias.length() > 0) {
              serviceName=serviceAlias;
              if (serviceClass == null && services.containsKey(serviceName)) {
                serviceClass=services.get(serviceName).getClassName();
              }
            }
          }
          if (StringUtils.isNotBlank(serviceName)) {
            services.put(serviceName,new ContainerService(serviceName,serviceClass,true,isPrivate));
          }
        }
      }
    }
  }
  return services;
}

Fixed version (ground truth):
@NotNull public Map<String,ContainerService> getLocalServiceMap(PsiFile psiFile){
  Map<String,ContainerService> services=new HashMap<String,ContainerService>();
  YAMLDocument yamlDocument=PsiTreeUtil.getChildOfType(psiFile,YAMLDocument.class);
  if (yamlDocument == null) {
    return services;
  }
  YAMLKeyValue[] yamlKeys=PsiTreeUtil.getChildrenOfType(yamlDocument,YAMLKeyValue.class);
  if (yamlKeys == null) {
    return services;
  }
  for (  YAMLKeyValue yamlKeyValue : yamlKeys) {
    String yamlConfigKey=yamlKeyValue.getName();
    if (yamlConfigKey != null && yamlConfigKey.equals("String_Node_Str")) {
      YAMLKeyValue yamlServices[]=PsiTreeUtil.getChildrenOfType(yamlKeyValue.getValue(),YAMLKeyValue.class);
      if (yamlServices != null) {
        for (        YAMLKeyValue yamlServiceKeyValue : yamlServices) {
          String serviceName=yamlServiceKeyValue.getName();
          String serviceClass=null;
          boolean isPrivate=false;
          YAMLKeyValue[] yamlServiceKeys=PsiTreeUtil.getChildrenOfType(yamlServiceKeyValue.getValue(),YAMLKeyValue.class);
          if (yamlServiceKeys != null) {
            String serviceClassName=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceClassName != null) {
              serviceClass=PsiElementUtils.trimQuote(serviceClassName);
              if (StringUtils.isBlank(serviceClass)) {
                serviceClass=null;
              }
            }
            String serviceIsPublic=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceIsPublic != null && serviceIsPublic.equals("String_Node_Str")) {
              isPrivate=true;
            }
            String serviceAlias=this.getKeyValue(yamlServiceKeyValue,"String_Node_Str");
            if (serviceAlias != null && serviceAlias.length() > 0) {
              serviceName=serviceAlias;
              if (serviceClass == null && services.containsKey(serviceName)) {
                serviceClass=services.get(serviceName).getClassName();
              }
            }
          }
          if (StringUtils.isNotBlank(serviceName)) {
            services.put(serviceName,new ContainerService(serviceName,serviceClass,true,isPrivate));
          }
        }
      }
    }
  }
  return services;
}