From ffcd14f8a86bdcbe6bd0d63bce767346b6c00b3b Mon Sep 17 00:00:00 2001 From: Tom Zurkan Date: Fri, 11 Oct 2019 11:14:33 -0700 Subject: [PATCH 1/2] (fix): use a ParserSupplier instead of java.util.Supplier to enable work on older versions of Android. (#340) * use a ParserSupplier to enable work on older versions of Android. * remove the generics --- .../ab/config/parser/DefaultConfigParser.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core-api/src/main/java/com/optimizely/ab/config/parser/DefaultConfigParser.java b/core-api/src/main/java/com/optimizely/ab/config/parser/DefaultConfigParser.java index 5e6bc84ef..ff1748cb0 100644 --- a/core-api/src/main/java/com/optimizely/ab/config/parser/DefaultConfigParser.java +++ b/core-api/src/main/java/com/optimizely/ab/config/parser/DefaultConfigParser.java @@ -38,6 +38,16 @@ public static ConfigParser getInstance() { } //======== Helper methods ========// + @FunctionalInterface + public interface ParserSupplier { + + /** + * Gets a result. + * + * @return a result + */ + ConfigParser get(); + } public enum ConfigParserSupplier { // WARNING THESE MUST REMAIN LAMBDAS!!! @@ -49,9 +59,9 @@ public enum ConfigParserSupplier { JSON_SIMPLE_CONFIG_PARSER("org.json.simple.JSONObject", () -> { return new JsonSimpleConfigParser(); }); private final String className; - private final Supplier supplier; + private final ParserSupplier supplier; - ConfigParserSupplier(String className, Supplier supplier) { + ConfigParserSupplier(String className, ParserSupplier supplier) { this.className = className; this.supplier = supplier; } From 642d024ffd0fa201649baf980e2d3ac2f098c61a Mon Sep 17 00:00:00 2001 From: Tom Zurkan Date: Fri, 11 Oct 2019 13:19:32 -0700 Subject: [PATCH 2/2] update for new release for android support (#341) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3088a599a..3de7c6690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Optimizely Java X SDK Changelog +## 3.3.1 +October 11th, 2019 + +### New Features: +- java.util.Supplier is not supported below Android API 24. In order to support Android 22 which still has more than 10% market share, we have changed our implementation to use our own config supplier interface. + ## 3.3.0 October 1st, 2019