private @Nullable OrderEntry getLibraryForFile(VirtualFile virtualFile) {
    if (virtualFile == null) return null;
    List<OrderEntry> orders = myFileIndex.getOrderEntriesForFile(virtualFile);
    for (OrderEntry order : orders) {
      if (order instanceof LibraryOrderEntry || order instanceof JdkOrderEntry) return order;
    }
    return null;
  }
private @Nullable OrderEntry getLibraryForFile(VirtualFile virtualFile)