Merge branch 'stable-3.10'

* stable-3.10:
  Fix NPE upon Git clone
  Update plugins yarn lock file for @gerritcodereview/typescript-api
  Set version to 3.10.0-SNAPSHOT
  Set version to 3.10.0-rc5
  Update @gerritcodereview/typescript-api to 3.9.1
  Bazel: Fix eclipse classpath generation
  Update @gerritcodereview/typescript-api to 3.9.1
  Update git submodules
  Update git submodules
  Fix inline editor
  Update CodeMirror plugin to head
  Update CodeMirror
  Upgrade yarn deps (April 2024)
  Index Change: Remove misleading documentation
  Fix javadocs for deprecation of Changes#id(int)
  ChangesByProjectCacheImpl: Update Change weigher
  Remove assignee config from docs
  gr-main-header: fix header to wrap the better
  gr-main-header: fix header to wrap the better
  Document introduction of `virtual_id_number` to `ChangeInfo`
  Add baseUrl to INITIAL_DATA in IndexHtmlUtil
  Add baseUrl to INITIAL_DATA in IndexHtmlUtil
  Fix clearing cache in gr-rest-api
  Fix clearing cache in gr-rest-api
  Remove reload-diff-preference unneeded event
  Remove reload-diff-preference unneeded event
  ServerPlugin: Fix buggy Optional.orElse()
  Fix buttons on header disappearing
  Fix buttons on header disappearing
  Set version to 3.9.5-SNAPSHOT
  Set version to 3.9.4
  Set version to 3.8.6-SNAPSHOT
  Set version to 3.8.5
  Fix endless loop when using "is:watched" in project watches

Release-Notes: skip
Change-Id: Ic9930ad8312bc5b5e8e3062a107eb4d284dd5324
diff --git a/Documentation/cmd-index-changes.txt b/Documentation/cmd-index-changes.txt
index 0ee7aab..1d4cbe34 100644
--- a/Documentation/cmd-index-changes.txt
+++ b/Documentation/cmd-index-changes.txt
@@ -16,8 +16,7 @@
 supported by the REST API.
 
 == ACCESS
-Caller must have the 'Maintain Server' capability, or be the owner of the change
-to be indexed.
+Caller must have the 'Maintain Server' capability.
 
 == SCRIPTING
 This command is intended to be used in scripts.
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index b338148..361fd3c 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -1641,13 +1641,6 @@
 +
 Default is `true`.
 
-[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
-+
-Show assignee field in changes table. If set to `false`, assignees will
-not be visible in changes table.
-+
-Default is `false`.
-
 [[change.strictLabels]]change.strictLabels::
 +
 Reject invalid label votes: invalid labels or invalid values. This
diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt
index b8160db..50885b6 100644
--- a/Documentation/rest-api-changes.txt
+++ b/Documentation/rest-api-changes.txt
@@ -7233,6 +7233,12 @@
 |`_number`            ||
 The change number. (The underscore is just a relict of a prior
 attempt to deprecate the change number.)
+|`virtual_id_number`  ||
+The virtual id number is globally unique. For local changes, it is equal to the
+`_number` attribute. For imported changes, the original `_number` is processed
+through a function designed to prevent conflicts with local change numbers.
+Note that its usage is intended solely for Gerrit's internals and UI, and
+adoption outside these scenarios is not advised.
 |`owner`              ||
 The owner of the change as an link:rest-api-accounts.html#account-info[
 AccountInfo] entity.
diff --git a/java/com/google/gerrit/extensions/api/changes/ChangeApi.java b/java/com/google/gerrit/extensions/api/changes/ChangeApi.java
index 1c83bc2..dec3125 100644
--- a/java/com/google/gerrit/extensions/api/changes/ChangeApi.java
+++ b/java/com/google/gerrit/extensions/api/changes/ChangeApi.java
@@ -132,13 +132,21 @@
     setReadyForReview(null);
   }
 
-  /** Create a new change that reverts this change. */
+  /**
+   * Create a new change that reverts this change.
+   *
+   * @see Changes#id(String, int)
+   */
   @CanIgnoreReturnValue
   default ChangeApi revert() throws RestApiException {
     return revert(new RevertInput());
   }
 
-  /** Create a new change that reverts this change. */
+  /**
+   * Create a new change that reverts this change.
+   *
+   * @see Changes#id(String, int)
+   */
   @CanIgnoreReturnValue
   ChangeApi revert(RevertInput in) throws RestApiException;
 
diff --git a/java/com/google/gerrit/extensions/api/changes/Changes.java b/java/com/google/gerrit/extensions/api/changes/Changes.java
index 5e3d08c..605a92e 100644
--- a/java/com/google/gerrit/extensions/api/changes/Changes.java
+++ b/java/com/google/gerrit/extensions/api/changes/Changes.java
@@ -32,14 +32,10 @@
   /**
    * Look up a change by numeric ID.
    *
-   * <p><strong>Note:</strong> This method eagerly reads the change. Methods that mutate the change
-   * do not necessarily re-read the change. Therefore, calling a getter method on an instance after
-   * calling a mutation method on that same instance is not guaranteed to reflect the mutation. It
-   * is not recommended to store references to {@code ChangeApi} instances. Also note that the
-   * change numeric id without a project name parameter may fail to identify a unique change
-   * element, because the potential conflict with other changes imported from Gerrit instances with
-   * a different Server-Id.
+   * <p><strong>Note:</strong> Change number is not guaranteed to unambiguously identify a change.
    *
+   * @see #id(String, int)
+   * @deprecated in favor of {@link #id(String, int)}
    * @param id change number.
    * @return API for accessing the change.
    * @throws RestApiException if an error occurred.
@@ -50,7 +46,7 @@
   /**
    * Look up a change by string ID.
    *
-   * @see #id(int)
+   * @see #id(String, int)
    * @param id any identifier supported by the REST API, including change number, Change-Id, or
    *     project~branch~Change-Id triplet.
    * @return API for accessing the change.
@@ -61,16 +57,23 @@
   /**
    * Look up a change by project, branch, and change ID.
    *
-   * @see #id(int)
+   * @see #id(String, int)
    */
   ChangeApi id(String project, String branch, String id) throws RestApiException;
 
   /**
    * Look up a change by project and numeric ID.
    *
+   * <p><strong>Note:</strong> This method eagerly reads the change. Methods that mutate the change
+   * do not necessarily re-read the change. Therefore, calling a getter method on an instance after
+   * calling a mutation method on that same instance is not guaranteed to reflect the mutation. It
+   * is not recommended to store references to {@code ChangeApi} instances. Also note that the
+   * change numeric id without a project name parameter may fail to identify a unique change
+   * element, because the potential conflict with other changes imported from Gerrit instances with
+   * a different Server-Id.
+   *
    * @param project project name.
    * @param id change number.
-   * @see #id(int)
    */
   ChangeApi id(String project, int id) throws RestApiException;
 
diff --git a/java/com/google/gerrit/extensions/common/ChangeInfo.java b/java/com/google/gerrit/extensions/common/ChangeInfo.java
index 4a3b423..52127e4 100644
--- a/java/com/google/gerrit/extensions/common/ChangeInfo.java
+++ b/java/com/google/gerrit/extensions/common/ChangeInfo.java
@@ -102,7 +102,7 @@
   public Boolean containsGitConflicts;
 
   public Integer _number;
-  public Integer _virtualIdNumber;
+  public Integer virtualIdNumber;
 
   public AccountInfo owner;
 
diff --git a/java/com/google/gerrit/server/change/ChangeJson.java b/java/com/google/gerrit/server/change/ChangeJson.java
index a5da7c2..46f3e0e 100644
--- a/java/com/google/gerrit/server/change/ChangeJson.java
+++ b/java/com/google/gerrit/server/change/ChangeJson.java
@@ -806,7 +806,7 @@
       }
     }
 
-    out._virtualIdNumber = cd.virtualId().get();
+    out.virtualIdNumber = cd.virtualId().get();
 
     return out;
   }
@@ -1086,7 +1086,7 @@
     // repository only once
     try (Repository allUsersRepo = repoManager.openRepository(allUsers)) {
       List<Change.Id> changeIds =
-          changeInfos.stream().map(c -> Change.id(c._virtualIdNumber)).collect(Collectors.toList());
+          changeInfos.stream().map(c -> Change.id(c.virtualIdNumber)).collect(Collectors.toList());
       Set<Change.Id> starredChanges =
           starredChangesreader.areStarred(
               allUsersRepo, changeIds, userProvider.get().asIdentifiedUser().getAccountId());
@@ -1094,7 +1094,7 @@
         return;
       }
       changeInfos.stream()
-          .forEach(c -> c.starred = starredChanges.contains(Change.id(c._virtualIdNumber)));
+          .forEach(c -> c.starred = starredChanges.contains(Change.id(c.virtualIdNumber)));
     } catch (IOException e) {
       logger.atWarning().withCause(e).log("Failed to open All-Users repo.");
     }
diff --git a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
index ed16006..2bbd261 100644
--- a/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
+++ b/java/com/google/gerrit/server/git/ChangesByProjectCacheImpl.java
@@ -286,6 +286,7 @@
       int size = 0;
       size += JavaWeights.OBJECT; // change
       size += JavaWeights.REFERENCE + GerritWeights.KEY_INT; // changeId
+      size += JavaWeights.REFERENCE + (c.getServerId() == null ? 0 : c.getServerId().length());
       size += JavaWeights.REFERENCE + JavaWeights.OBJECT + 40; // changeKey;
       size += JavaWeights.REFERENCE + GerritWeights.TIMESTAMP; // createdOn;
       size += JavaWeights.REFERENCE + GerritWeights.TIMESTAMP; // lastUpdatedOn;
@@ -303,12 +304,12 @@
               + (c.getOriginalSubject().equals(c.getSubject()) ? 0 : c.getSubject().length());
       size +=
           JavaWeights.REFERENCE + (c.getSubmissionId() == null ? 0 : c.getSubmissionId().length());
-      size += JavaWeights.REFERENCE + GerritWeights.ACCOUNT_ID; // assignee;
       size += JavaWeights.REFERENCE + JavaWeights.BOOLEAN; // isPrivate;
       size += JavaWeights.REFERENCE + JavaWeights.BOOLEAN; // workInProgress;
       size += JavaWeights.REFERENCE + JavaWeights.BOOLEAN; // reviewStarted;
-      size += JavaWeights.REFERENCE + GerritWeights.CHANGE_NUM; // revertOf;
-      size += JavaWeights.REFERENCE + GerritWeights.PACTCH_SET_ID; // cherryPickOf;
+      size += JavaWeights.REFERENCE + (c.getRevertOf() == null ? 0 : GerritWeights.CHANGE_NUM);
+      size +=
+          JavaWeights.REFERENCE + (c.getCherryPickOf() == null ? 0 : GerritWeights.PACTCH_SET_ID);
       return size;
     }
 
diff --git a/java/com/google/gerrit/server/plugins/ServerPlugin.java b/java/com/google/gerrit/server/plugins/ServerPlugin.java
index 340e431..bd83b98 100644
--- a/java/com/google/gerrit/server/plugins/ServerPlugin.java
+++ b/java/com/google/gerrit/server/plugins/ServerPlugin.java
@@ -286,7 +286,7 @@
     modules.add(new ServerPluginInfoModule(this, env.getServerMetrics()));
     return apiInjector
         .map(injector -> injector.createChildInjector(modules))
-        .orElse(Guice.createInjector(modules));
+        .orElseGet(() -> Guice.createInjector(modules));
   }
 
   private Injector newRootInjectorWithApiModule(
diff --git a/plugins/package.json b/plugins/package.json
index 6aa106f..37b3dda 100644
--- a/plugins/package.json
+++ b/plugins/package.json
@@ -28,7 +28,7 @@
     "@codemirror/search": "^6.5.6",
     "@codemirror/state": "^6.4.1",
     "@codemirror/view": "^6.26.3",
-    "@gerritcodereview/typescript-api": "3.8.0",
+    "@gerritcodereview/typescript-api": "3.9.1",
     "@open-wc/testing": "^3.2.2",
     "@polymer/decorators": "^3.0.0",
     "@polymer/polymer": "^3.5.1",
diff --git a/plugins/yarn.lock b/plugins/yarn.lock
index 128f7c2..d19952c 100644
--- a/plugins/yarn.lock
+++ b/plugins/yarn.lock
@@ -472,10 +472,10 @@
   dependencies:
     "@types/chai" "^4.2.12"
 
-"@gerritcodereview/typescript-api@3.8.0":
-  version "3.8.0"
-  resolved "https://registry.yarnpkg.com/@gerritcodereview/typescript-api/-/typescript-api-3.8.0.tgz#2e418b814d7451c40365b2dc4f88e9965ece0769"
-  integrity sha512-wUkIWUx99Rj1vxRYQISxyzN0nplqu7t5sRDyJ8R3yNNkvALQAMC6Whj63qzCsZsymVFzC5up3y+ZVxaeh7b+xA==
+"@gerritcodereview/typescript-api@3.9.1":
+  version "3.9.1"
+  resolved "https://registry.yarnpkg.com/@gerritcodereview/typescript-api/-/typescript-api-3.9.1.tgz#c532e9a39e3d5f16f6a5cb5691988c04cd477531"
+  integrity sha512-5t8CBhlqQEcjJqNld1/ajcdZjjyrv7vsn4u0N3mX4hc4DnPJimIjYVFvP8nLyhSkioawWDIRLvzlmfzFs02lDg==
 
 "@jridgewell/resolve-uri@^3.1.0":
   version "3.1.2"
diff --git a/tools/eclipse/project.py b/tools/eclipse/project.py
index 9a28d9d..1c2443e 100755
--- a/tools/eclipse/project.py
+++ b/tools/eclipse/project.py
@@ -97,6 +97,7 @@
         cmd.append(arg)
     if custom_java:
         cmd.append('--config=java%s' % custom_java)
+    cmd.append('--remote_download_outputs=all')
     return cmd