From 154163aaf35c45719c1e665dc1b011f70722390e Mon Sep 17 00:00:00 2001 From: Jakub Kozlowski Date: Fri, 22 May 2020 12:29:16 +0100 Subject: [PATCH] Fix deserialization issue. (#4795) * Previous released broke the API under the assumption that we were always sending Optional.empty before. * But then we pushed the wrong version, so pushing an Optional.of. --- changelog/@unreleased/pr-4795.v2.yml | 6 ++++++ .../com/palantir/lock/watch/NoOpLockWatchEventCache.java | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog/@unreleased/pr-4795.v2.yml diff --git a/changelog/@unreleased/pr-4795.v2.yml b/changelog/@unreleased/pr-4795.v2.yml new file mode 100644 index 00000000000..11218f6b272 --- /dev/null +++ b/changelog/@unreleased/pr-4795.v2.yml @@ -0,0 +1,6 @@ +type: improvement +improvement: + description: |- + Fix deserialization issue. + links: + - https://github.com/palantir/atlasdb/pull/4795 diff --git a/lock-api-objects/src/main/java/com/palantir/lock/watch/NoOpLockWatchEventCache.java b/lock-api-objects/src/main/java/com/palantir/lock/watch/NoOpLockWatchEventCache.java index 67b474ab3ca..01c0d93b448 100644 --- a/lock-api-objects/src/main/java/com/palantir/lock/watch/NoOpLockWatchEventCache.java +++ b/lock-api-objects/src/main/java/com/palantir/lock/watch/NoOpLockWatchEventCache.java @@ -26,7 +26,6 @@ public class NoOpLockWatchEventCache implements LockWatchEventCache { public static final LockWatchEventCache INSTANCE = new NoOpLockWatchEventCache(); private static final IdentifiedVersion FAKE = ImmutableIdentifiedVersion.of(UUID.randomUUID(), 0L); - private static final Optional FAKE_OPTIONAL_VERSION = Optional.of(FAKE); private static final TransactionsLockWatchEvents NONE = TransactionsLockWatchEvents.failure( LockWatchStateUpdate.snapshot(UUID.randomUUID(), -1L, ImmutableSet.of(), ImmutableSet.of())); @@ -36,7 +35,7 @@ private NoOpLockWatchEventCache() { @Override public Optional lastKnownVersion() { - return FAKE_OPTIONAL_VERSION; + return Optional.empty(); } @Override