Merge branch 'stable-3.1'
* stable-3.1:
Upgrade bazlets to latest stable-2.16 to build with 2.16.18 API
Bump Bazel version to 3.1.0
Change-Id: Ifb0d352a07de8c71797573f8262204aca0e7b428
diff --git a/BUILD b/BUILD
index 35d676e..d5a550f 100644
--- a/BUILD
+++ b/BUILD
@@ -1,4 +1,3 @@
-load("@rules_java//java:defs.bzl", "java_library")
load("//tools/bzl:junit.bzl", "junit_tests")
load(
"//tools/bzl:plugin.bzl",
diff --git a/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java b/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
index a31f99c..5e1d54d 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/webhooks/rest/ProjectsCollection.java
@@ -53,7 +53,7 @@
private ProjectWebhooksResource parse(String id) throws ResourceNotFoundException {
Project.NameKey n = Project.nameKey(id);
- if (projectCache.get(n) != null) {
+ if (projectCache.get(n).isPresent()) {
return new ProjectWebhooksResource(Project.nameKey(id));
}
throw new ResourceNotFoundException(String.format("Project %s does not exist", id));