Fix Java 8 build and avoid Optional.isEmpty() Gerrit v3.4 should still be source compatible with Java 8 therefore the Java 11's Optional.isEmpty() should be replaced with !Optional.isPresent(). Change-Id: I52491602086c0df8b39e1ee95c5e53c21d10042d
diff --git a/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/MultisiteReplicationFetchFilter.java b/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/MultisiteReplicationFetchFilter.java index d355984..21d4073 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/MultisiteReplicationFetchFilter.java +++ b/src/main/java/com/googlesource/gerrit/plugins/multisite/validation/MultisiteReplicationFetchFilter.java
@@ -76,7 +76,7 @@ ref, oid.getName())); - return localRefOid.isEmpty(); + return !localRefOid.isPresent(); }) .collect(Collectors.toSet()); } catch (IOException ioe) { @@ -129,7 +129,7 @@ .orElse(false)) .map(Ref::getObjectId); - if (localRefObjectId.isEmpty() && retryWithRandomSleep) { + if (!localRefObjectId.isPresent() && retryWithRandomSleep) { randomSleepForMitigatingConditionWhereLocalRefHaveJustBeenChanged( projectName, localRefObjectId, ref); localRefObjectId =