Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 770169b

Browse files
committed
fix unmarshaling of stream put data
1 parent abf058b commit 770169b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/com/launchdarkly/client/StreamProcessor.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public void onMessage(String name, MessageEvent event) throws Exception {
8383
Gson gson = new Gson();
8484
switch (name) {
8585
case PUT: {
86-
FeatureRequestor.AllData allData = gson.fromJson(event.getData(), FeatureRequestor.AllData.class);
87-
store.init(FeatureRequestor.toVersionedDataMap(allData));
86+
PutData putData = gson.fromJson(event.getData(), PutData.class);
87+
store.init(FeatureRequestor.toVersionedDataMap(putData.data));
8888
if (!initialized.getAndSet(true)) {
8989
initFuture.set(null);
9090
logger.info("Initialized LaunchDarkly client.");
@@ -200,6 +200,14 @@ public boolean initialized() {
200200
return initialized.get();
201201
}
202202

203+
private static final class PutData {
204+
FeatureRequestor.AllData data;
205+
206+
public PutData() {
207+
208+
}
209+
}
210+
203211
private static final class PatchData {
204212
String path;
205213
JsonElement data;

0 commit comments

Comments
 (0)