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 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; }