Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  Documentation: Fix plugins install REST API & curl example
  Fix minor typo in WORKSPACE
  Fix `parent` in `gr-change-metadata` when switching patchsets
  Update git submodules
  Revert "Fix edit diff url"
  Upgrade testcontainers to 1.14.2
  Update git submodules
  Fix Postgresql JDBC driver leaking memory

Change-Id: Ie81d10920e897d939ca144ec1d95130119cfb7f0
diff --git a/Documentation/rest-api-plugins.txt b/Documentation/rest-api-plugins.txt
index c34fe77..77b180e 100644
--- a/Documentation/rest-api-plugins.txt
+++ b/Documentation/rest-api-plugins.txt
@@ -246,7 +246,7 @@
 [[install-plugin]]
 === Install Plugin
 --
-'PUT /plugins/link:#plugin-id[\{plugin-id\}]'
+'PUT /plugins/link:#plugin-id[\{plugin-id\}].jar'
 --
 
 Installs a new plugin on the Gerrit server. If a plugin with the
@@ -260,7 +260,7 @@
 
 .Request
 ----
-  PUT /plugins/delete-project HTTP/1.0
+  PUT /plugins/delete-project.jar HTTP/1.0
   Content-Type: application/json; charset=UTF-8
 
   {
@@ -272,7 +272,7 @@
 following curl command can be used:
 
 ----
-  curl --user admin:TNNuLkWsIV8w -X PUT --data-binary @delete-project-2.8.jar 'http://gerrit:8080/a/plugins/delete-project'
+  curl --user admin:TNNuLkWsIV8w -X PUT -H "Content-Type:application/octet-stream" --data-binary @delete-project.jar 'http://gerrit:8080/a/plugins/delete-project.jar'
 ----
 
 As response a link:#plugin-info[PluginInfo] entity is returned that
@@ -282,12 +282,15 @@
 ----
   HTTP/1.1 201 Created
   Content-Disposition: attachment
-  Content-Type: application/json; charset=UTF-8
+  Content-Type: application/json;charset=utf-8
+  Content-Length: 150
 
   )]}'
   {
     "id": "delete-project",
-    "version": "2.8"
+    "version": "v2.16-221-g35bb8bbac4",
+    "index_url": "plugins/delete-project/",
+    "filename": "delete-project.jar"
   }
 ----
 
diff --git a/WORKSPACE b/WORKSPACE
index 8133718..ef43fc7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -238,7 +238,7 @@
 CAFFEINE_GUAVA_SHA256 = "3a66ee3ec70971dee0bae6e56bda7b8742bc4bedd7489161bfbbaaf7137d89e1"
 
 # TODO(davido): Rename guava.jar to caffeine-guava.jar on fetch to prevent potential
-# naming collision between caffeine guava adapater and guava library itself.
+# naming collision between caffeine guava adapter and guava library itself.
 # Remove this renaming procedure, once this upstream issue is fixed:
 # https://github.com/ben-manes/caffeine/issues/364.
 http_file(
diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
index b6d0faa..8f3f54b 100644
--- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
+++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata.js
@@ -114,7 +114,7 @@
 
       _currentParents: {
         type: Array,
-        computed: '_computeParents(change)',
+        computed: '_computeParents(revision)',
       },
 
       /** @type {?} */
@@ -431,13 +431,11 @@
       return null;
     },
 
-    _computeParents(change) {
-      if (!change || !change.current_revision ||
-          !change.revisions[change.current_revision] ||
-          !change.revisions[change.current_revision].commit) {
+    _computeParents(revision) {
+      if (!revision || !revision.commit) {
         return undefined;
       }
-      return change.revisions[change.current_revision].commit.parents;
+      return revision.commit.parents;
     },
 
     _computeParentsLabel(parents) {
diff --git a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
index 6f06fc8..ec78a15 100644
--- a/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
+++ b/polygerrit-ui/app/elements/change/gr-change-metadata/gr-change-metadata_test.html
@@ -419,14 +419,20 @@
     });
 
     test('_computeParents', () => {
-      const parents = [{commit: '123', subject: 'abc'}];
-      assert.isUndefined(element._computeParents(
-          {revisions: {456: {commit: {parents}}}}));
-      assert.isUndefined(element._computeParents(
-          {current_revision: '789', revisions: {456: {commit: {parents}}}}));
-      assert.equal(element._computeParents(
-          {current_revision: '456', revisions: {456: {commit: {parents}}}}),
-      parents);
+      const revision = {commit: {parents: [{commit: '123', subject: 'abc'}]}};
+      assert.isUndefined(element._computeParents({}));
+      assert.equal(element._computeParents(revision), revision.commit.parents);
+    });
+
+    test('_currentParents', () => {
+      element.revision = {
+        commit: {parents: [{commit: '123', subject: 'abc'}]},
+      };
+      assert.equal(element._currentParents[0].commit, '123');
+      element.revision = {
+        commit: {parents: [{commit: '12345', subject: 'abc'}]},
+      };
+      assert.equal(element._currentParents[0].commit, '12345');
     });
 
     test('_computeParentsLabel', () => {
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
index 142bd6a..bd0486f 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
@@ -568,7 +568,8 @@
 
     _goToEditFile() {
       // TODO(taoalpha): add a shortcut for editing
-      const editUrl = Gerrit.Nav.getEditUrlForDiff(this._change, this._path);
+      const editUrl = Gerrit.Nav.getEditUrlForDiff(
+          this._change, this._path, this._patchRange.patchNum);
       return Gerrit.Nav.navigateToRelativeUrl(editUrl);
     },
 
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html
index 046a153..9c59577 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html
+++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view_test.html
@@ -394,7 +394,6 @@
       };
       element._change = {
         _number: 42,
-        project: 'gerrit',
         status: 'NEW',
         revisions: {
           a: {_number: 1, commit: {parents: []}},
@@ -408,8 +407,6 @@
         assert.isTrue(!!editBtn);
         MockInteractions.tap(editBtn);
         assert.isTrue(redirectStub.called);
-        assert.isTrue(redirectStub.lastCall.calledWithExactly(
-            Gerrit.Nav.getEditUrlForDiff(element._change, element._path)));
         done();
       });
     });
diff --git a/tools/nongoogle.bzl b/tools/nongoogle.bzl
index 5270df5..5e2e4e1 100644
--- a/tools/nongoogle.bzl
+++ b/tools/nongoogle.bzl
@@ -126,18 +126,18 @@
         sha1 = "dc13ae4faca6df981fc7aeb5a522d9db446d5d50",
     )
 
-    TESTCONTAINERS_VERSION = "1.14.1"
+    TESTCONTAINERS_VERSION = "1.14.2"
 
     maven_jar(
         name = "testcontainers",
         artifact = "org.testcontainers:testcontainers:" + TESTCONTAINERS_VERSION,
-        sha1 = "defd04ff6ffc93e1ff988024048e8ba5bd298df3",
+        sha1 = "d74bc045fb5f30988b0adff20244412972a9f564",
     )
 
     maven_jar(
         name = "testcontainers-elasticsearch",
         artifact = "org.testcontainers:elasticsearch:" + TESTCONTAINERS_VERSION,
-        sha1 = "d682965bbf1334ef40720b4ad2eda2c12bf0b440",
+        sha1 = "66e1a6da0362beee83673b877c9c2e0536d6912c",
     )
 
     maven_jar(