From 7e1f69bd4b07a5cc204ccb1b568b516704fb0746 Mon Sep 17 00:00:00 2001 From: Dan Richelson Date: Wed, 30 Nov 2016 09:03:09 -0800 Subject: [PATCH] Make delete flags delete things better. --- .../java/com/launchdarkly/client/InMemoryFeatureStore.java | 2 +- .../java/com/launchdarkly/client/RedisFeatureStore.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/launchdarkly/client/InMemoryFeatureStore.java b/src/main/java/com/launchdarkly/client/InMemoryFeatureStore.java index c1ecb6026..3dd3aa32b 100644 --- a/src/main/java/com/launchdarkly/client/InMemoryFeatureStore.java +++ b/src/main/java/com/launchdarkly/client/InMemoryFeatureStore.java @@ -105,7 +105,7 @@ public void delete(String key, int version) { FeatureFlag f = features.get(key); if (f != null && f.getVersion() < version) { FeatureFlagBuilder newBuilder = new FeatureFlagBuilder(f); - newBuilder.on(false); + newBuilder.deleted(true); newBuilder.version(version); features.put(key, newBuilder.build()); } else if (f == null) { diff --git a/src/main/java/com/launchdarkly/client/RedisFeatureStore.java b/src/main/java/com/launchdarkly/client/RedisFeatureStore.java index 39ef5957d..8694d403d 100644 --- a/src/main/java/com/launchdarkly/client/RedisFeatureStore.java +++ b/src/main/java/com/launchdarkly/client/RedisFeatureStore.java @@ -296,7 +296,7 @@ public void delete(String key, int version) { } FeatureFlagBuilder newBuilder = new FeatureFlagBuilder(feature); - newBuilder.on(false); + newBuilder.deleted(true); newBuilder.version(version); jedis.hset(featuresKey(), key, gson.toJson(newBuilder.build())); @@ -424,9 +424,8 @@ private FeatureFlag getRedis(String key) { } } - private static final JedisPoolConfig getPoolConfig() { - JedisPoolConfig config = new JedisPoolConfig(); - return config; + private static JedisPoolConfig getPoolConfig() { + return new JedisPoolConfig(); } }