Merge branch 'stable-2.15'

* stable-2.15:
  Format BUILD file with buildifier 0.12.0
  Format .bzl files with buildifier 0.12.0
  Update bazlets to use 2.14.10 API
  Remove wildcard import
  Upgrade bazlets to latest revision on stable-2.14 to use 2.14.9 API
  Trigger the reload of Change notes before reindexing

Change-Id: I80c40f71bb3c88024584136d9167cf2d8dcace4b
diff --git a/BUILD b/BUILD
index 202e13b..7fec2ea 100644
--- a/BUILD
+++ b/BUILD
@@ -1,9 +1,9 @@
 load("//tools/bzl:junit.bzl", "junit_tests")
 load(
     "//tools/bzl:plugin.bzl",
-    "gerrit_plugin",
     "PLUGIN_DEPS",
     "PLUGIN_TEST_DEPS",
+    "gerrit_plugin",
 )
 
 gerrit_plugin(
diff --git a/bazlets.bzl b/bazlets.bzl
index e14e488..f97b72c 100644
--- a/bazlets.bzl
+++ b/bazlets.bzl
@@ -1,17 +1,16 @@
 NAME = "com_googlesource_gerrit_bazlets"
 
 def load_bazlets(
-    commit,
-    local_path = None
-  ):
-  if not local_path:
-      native.git_repository(
-          name = NAME,
-          remote = "https://gerrit.googlesource.com/bazlets",
-          commit = commit,
-      )
-  else:
-      native.local_repository(
-          name = NAME,
-          path = local_path,
-      )
+        commit,
+        local_path = None):
+    if not local_path:
+        native.git_repository(
+            name = NAME,
+            remote = "https://gerrit.googlesource.com/bazlets",
+            commit = commit,
+        )
+    else:
+        native.local_repository(
+            name = NAME,
+            path = local_path,
+        )
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index 364369b..f3249eb 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -1,45 +1,45 @@
 load("//tools/bzl:maven_jar.bzl", "maven_jar")
 
 def external_plugin_deps():
-  maven_jar(
-    name = "wiremock",
-    artifact = "com.github.tomakehurst:wiremock-standalone:2.8.0",
-    sha1 = "b4d91aca283a86b447d3906deac6e1509c3a94c5",
-  )
+    maven_jar(
+        name = "wiremock",
+        artifact = "com.github.tomakehurst:wiremock-standalone:2.8.0",
+        sha1 = "b4d91aca283a86b447d3906deac6e1509c3a94c5",
+    )
 
-  maven_jar(
-    name = "mockito",
-    artifact = "org.mockito:mockito-core:2.15.0",
-    sha1 = "b84bfbbc29cd22c9529409627af6ea2897f4fa85",
-    deps = [
-      "@byte_buddy//jar",
-      "@byte_buddy_agent//jar",
-      "@objenesis//jar",
-    ],
-  )
+    maven_jar(
+        name = "mockito",
+        artifact = "org.mockito:mockito-core:2.15.0",
+        sha1 = "b84bfbbc29cd22c9529409627af6ea2897f4fa85",
+        deps = [
+            "@byte_buddy//jar",
+            "@byte_buddy_agent//jar",
+            "@objenesis//jar",
+        ],
+    )
 
-  BYTE_BUDDY_VER = "1.7.9"
+    BYTE_BUDDY_VER = "1.7.9"
 
-  maven_jar(
-    name = "byte_buddy",
-    artifact = "net.bytebuddy:byte-buddy:" + BYTE_BUDDY_VER,
-    sha1 = "51218a01a882c04d0aba8c028179cce488bbcb58",
-  )
+    maven_jar(
+        name = "byte_buddy",
+        artifact = "net.bytebuddy:byte-buddy:" + BYTE_BUDDY_VER,
+        sha1 = "51218a01a882c04d0aba8c028179cce488bbcb58",
+    )
 
-  maven_jar(
-    name = "byte_buddy_agent",
-    artifact = "net.bytebuddy:byte-buddy-agent:" + BYTE_BUDDY_VER,
-    sha1 = "a6c65f9da7f467ee1f02ff2841ffd3155aee2fc9",
-  )
+    maven_jar(
+        name = "byte_buddy_agent",
+        artifact = "net.bytebuddy:byte-buddy-agent:" + BYTE_BUDDY_VER,
+        sha1 = "a6c65f9da7f467ee1f02ff2841ffd3155aee2fc9",
+    )
 
-  maven_jar(
-    name = "objenesis",
-    artifact = "org.objenesis:objenesis:2.6",
-    sha1 = "639033469776fd37c08358c6b92a4761feb2af4b",
-  )
+    maven_jar(
+        name = "objenesis",
+        artifact = "org.objenesis:objenesis:2.6",
+        sha1 = "639033469776fd37c08358c6b92a4761feb2af4b",
+    )
 
-  maven_jar(
-    name = "jgroups",
-    artifact = "org.jgroups:jgroups:3.6.15.Final",
-    sha1 = "755afcfc6c8a8ea1e15ef0073417c0b6e8c6d6e4",
-  )
+    maven_jar(
+        name = "jgroups",
+        artifact = "org.jgroups:jgroups:3.6.15.Final",
+        sha1 = "755afcfc6c8a8ea1e15ef0073417c0b6e8c6d6e4",
+    )
diff --git a/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java b/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java
index fdbc71e..c455233 100644
--- a/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java
+++ b/src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java
@@ -53,6 +53,7 @@
     try (ReviewDb db = schemaFactory.open()) {
       change = changeFinder.findOne(id);
       if (change != null) {
+        change.reload();
         indexer.index(db, change.getChange());
         log.debug("Change {} successfully indexed", id);
       }
diff --git a/src/test/java/com/ericsson/gerrit/plugins/highavailability/cache/ProjectListUpdateHandlerTest.java b/src/test/java/com/ericsson/gerrit/plugins/highavailability/cache/ProjectListUpdateHandlerTest.java
index f6865ec..ec114f7 100644
--- a/src/test/java/com/ericsson/gerrit/plugins/highavailability/cache/ProjectListUpdateHandlerTest.java
+++ b/src/test/java/com/ericsson/gerrit/plugins/highavailability/cache/ProjectListUpdateHandlerTest.java
@@ -15,9 +15,10 @@
 package com.ericsson.gerrit.plugins.highavailability.cache;
 
 import static com.google.common.truth.Truth.assertThat;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.when;
 
 import com.ericsson.gerrit.plugins.highavailability.cache.ProjectListUpdateHandler.ProjectListUpdateTask;
 import com.ericsson.gerrit.plugins.highavailability.forwarder.Context;
diff --git a/tools/bzl/classpath.bzl b/tools/bzl/classpath.bzl
index dfcbe9c..d5764f7 100644
--- a/tools/bzl/classpath.bzl
+++ b/tools/bzl/classpath.bzl
@@ -1,2 +1,4 @@
-load("@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
-     "classpath_collector")
+load(
+    "@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
+    "classpath_collector",
+)
diff --git a/tools/bzl/plugin.bzl b/tools/bzl/plugin.bzl
index a2e438f..0b25d23 100644
--- a/tools/bzl/plugin.bzl
+++ b/tools/bzl/plugin.bzl
@@ -1,6 +1,6 @@
 load(
     "@com_googlesource_gerrit_bazlets//:gerrit_plugin.bzl",
-    "gerrit_plugin",
     "PLUGIN_DEPS",
     "PLUGIN_TEST_DEPS",
+    "gerrit_plugin",
 )