Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
public class ProjectConfig {

public enum Version {
V1 ("1"),
V2 ("2"),
V3 ("3");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ public ProjectConfig parseProjectConfig(@Nonnull String json) throws ConfigParse
List<Experiment> experiments = parseExperiments(rootObject.getJSONArray("experiments"));

List<Attribute> attributes;
if (version.equals(ProjectConfig.Version.V1.toString())) {
attributes = parseAttributes(rootObject.getJSONArray("dimensions"));
} else {
attributes = parseAttributes(rootObject.getJSONArray("attributes"));
}
attributes = parseAttributes(rootObject.getJSONArray("attributes"));

List<EventType> events = parseEvents(rootObject.getJSONArray("events"));
List<Audience> audiences = parseAudiences(rootObject.getJSONArray("audiences"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ public ProjectConfig parseProjectConfig(@Nonnull String json) throws ConfigParse
List<Experiment> experiments = parseExperiments((JSONArray)rootObject.get("experiments"));

List<Attribute> attributes;
if (version.equals(ProjectConfig.Version.V1.toString())) {
throw new ConfigParseException("The Java SDK no longer supports datafile version 1. If you wish to use a Classic Custom Project, please use Java SDK version 1.6 or below.");
} else {
attributes = parseAttributes((JSONArray)rootObject.get("attributes"));
}
attributes = parseAttributes((JSONArray)rootObject.get("attributes"));

List<EventType> events = parseEvents((JSONArray)rootObject.get("events"));
List<Audience> audiences = parseAudiences((JSONArray)parser.parse(rootObject.get("audiences").toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ public ProjectConfig deserialize(JsonElement json, Type typeOfT, JsonDeserializa
context.deserialize(jsonObject.get("experiments").getAsJsonArray(), experimentsType);

List<Attribute> attributes;
if (version.equals(ProjectConfig.Version.V1.toString())) {
attributes = context.deserialize(jsonObject.get("dimensions"), attributesType);
} else {
attributes = context.deserialize(jsonObject.get("attributes"), attributesType);
}
attributes = context.deserialize(jsonObject.get("attributes"), attributesType);

List<EventType> events =
context.deserialize(jsonObject.get("events").getAsJsonArray(), eventsType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ public ProjectConfig deserialize(JsonParser parser, DeserializationContext conte
new TypeReference<List<Experiment>>() {});

List<Attribute> attributes;
if (version.equals(ProjectConfig.Version.V1.toString())) {
attributes = mapper.readValue(node.get("dimensions").toString(), new TypeReference<List<Attribute>>() {});
} else {
attributes = mapper.readValue(node.get("attributes").toString(), new TypeReference<List<Attribute>>() {});
}
attributes = mapper.readValue(node.get("attributes").toString(), new TypeReference<List<Attribute>>() {});

List<EventType> events = mapper.readValue(node.get("events").toString(),
new TypeReference<List<EventType>>() {});
Expand Down