Program: 4111
Project: 4111
Buggy source:
private void collectTemplateFileRelatedFiles(@NotNull PsiFile psiFile,@NotNull Collection<LineMarkerInfo> collection,@NotNull LazyVirtualFileTemplateResolver resolver){
  Collection<String> collectedTemplates=resolver.resolveTemplateName(psiFile);
  if (collectedTemplates.size() == 0) {
    return;
  }
  Set<String> templateNames=new HashSet<>();
  for (  String templateName : collectedTemplates) {
    templateNames.add(templateName);
    templateNames.add(templateName.toLowerCase());
  }
  templateNames.addAll(new HashSet<>(templateNames).stream().map(templateName -> templateName.replace("String_Node_Str","String_Node_Str")).collect(Collectors.toList()));
  AtomicBoolean includeLineMarker=new AtomicBoolean(false);
  for (  ID<String,Void> key : Arrays.asList(BladeExtendsStubIndex.KEY,BladeSectionStubIndex.KEY,BladeIncludeStubIndex.KEY,BladeEachStubIndex.KEY)) {
    for (    String templateName : templateNames) {
      FileBasedIndex.getInstance().getFilesWithKey(key,new HashSet<>(Collections.singletonList(templateName)),virtualFile -> {
        includeLineMarker.set(true);
        return false;
      }
,GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(psiFile.getProject()),BladeFileType.INSTANCE));
    }
    if (includeLineMarker.get()) {
      break;
    }
  }
  if (includeLineMarker.get()) {
    NavigationGutterIconBuilder<PsiElement> builder=NavigationGutterIconBuilder.create(PhpIcons.IMPLEMENTED).setTargets(new TemplateIncludeCollectionNotNullLazyValue(psiFile.getProject(),templateNames)).setTooltipText("String_Node_Str");
    collection.add(builder.createLineMarkerInfo(psiFile));
  }
  boolean controllerLineMarker=false;
  for (  String templateName : templateNames) {
    Collection<VirtualFile> files=FileBasedIndex.getInstance().getContainingFiles(PhpTemplateUsageStubIndex.KEY,templateName,GlobalSearchScope.allScope(psiFile.getProject()));
    if (files.size() > 0) {
      controllerLineMarker=true;
      break;
    }
  }
  if (controllerLineMarker) {
    NavigationGutterIconBuilder<PsiElement> builder=NavigationGutterIconBuilder.create(LaravelIcons.TEMPLATE_CONTROLLER_LINE_MARKER).setTargets(new ControllerRenderViewCollectionNotNullLazyValue(psiFile.getProject(),templateNames)).setTooltipText("String_Node_Str");
    collection.add(builder.createLineMarkerInfo(psiFile));
  }
}

Fixed version (ground truth):
@NotNull private Collection<LineMarkerInfo> collectTemplateFileRelatedFiles(@NotNull PsiFile psiFile,@NotNull LazyVirtualFileTemplateResolver resolver){
  Collection<String> collectedTemplates=resolver.resolveTemplateName(psiFile);
  if (collectedTemplates.size() == 0) {
    return Collections.emptyList();
  }
  Set<String> templateNames=new HashSet<>();
  for (  String templateName : collectedTemplates) {
    templateNames.add(templateName);
    templateNames.add(templateName.toLowerCase());
  }
  templateNames.addAll(new HashSet<>(templateNames).stream().map(templateName -> templateName.replace("String_Node_Str","String_Node_Str")).collect(Collectors.toList()));
  AtomicBoolean includeLineMarker=new AtomicBoolean(false);
  for (  ID<String,Void> key : Arrays.asList(BladeExtendsStubIndex.KEY,BladeSectionStubIndex.KEY,BladeIncludeStubIndex.KEY,BladeEachStubIndex.KEY)) {
    for (    String templateName : templateNames) {
      FileBasedIndex.getInstance().getFilesWithKey(key,new HashSet<>(Collections.singletonList(templateName)),virtualFile -> {
        includeLineMarker.set(true);
        return false;
      }
,GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(psiFile.getProject()),BladeFileType.INSTANCE));
    }
    if (includeLineMarker.get()) {
      break;
    }
  }
  Collection<LineMarkerInfo> lineMarkers=new ArrayList<>();
  if (includeLineMarker.get()) {
    NavigationGutterIconBuilder<PsiElement> builder=NavigationGutterIconBuilder.create(PhpIcons.IMPLEMENTED).setTargets(new TemplateIncludeCollectionNotNullLazyValue(psiFile.getProject(),templateNames)).setTooltipText("String_Node_Str");
    lineMarkers.add(builder.createLineMarkerInfo(psiFile));
  }
  boolean controllerLineMarker=false;
  for (  String templateName : templateNames) {
    Collection<VirtualFile> files=FileBasedIndex.getInstance().getContainingFiles(PhpTemplateUsageStubIndex.KEY,templateName,GlobalSearchScope.allScope(psiFile.getProject()));
    if (files.size() > 0) {
      controllerLineMarker=true;
      break;
    }
  }
  if (controllerLineMarker) {
    NavigationGutterIconBuilder<PsiElement> builder=NavigationGutterIconBuilder.create(LaravelIcons.TEMPLATE_CONTROLLER_LINE_MARKER).setTargets(new ControllerRenderViewCollectionNotNullLazyValue(psiFile.getProject(),templateNames)).setTooltipText("String_Node_Str");
    lineMarkers.add(builder.createLineMarkerInfo(psiFile));
  }
  return lineMarkers;
}