Skip to content

Commit 38d6606

Browse files
authoredOct 11, 2019
(chore): chrerry pick changes to 3.3.x. (#342)
* (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 * update for new release for android support (#341)
1 parent 6d95ea3 commit 38d6606

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed
 

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Optimizely Java X SDK Changelog
22

3+
## 3.3.1
4+
October 11th, 2019
5+
6+
### New Features:
7+
- 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.
8+
39
## 3.3.0
410
October 1st, 2019
511

‎core-api/src/main/java/com/optimizely/ab/config/parser/DefaultConfigParser.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ public static ConfigParser getInstance() {
3838
}
3939

4040
//======== Helper methods ========//
41+
@FunctionalInterface
42+
public interface ParserSupplier {
43+
44+
/**
45+
* Gets a result.
46+
*
47+
* @return a result
48+
*/
49+
ConfigParser get();
50+
}
4151

4252
public enum ConfigParserSupplier {
4353
// WARNING THESE MUST REMAIN LAMBDAS!!!
@@ -49,9 +59,9 @@ public enum ConfigParserSupplier {
4959
JSON_SIMPLE_CONFIG_PARSER("org.json.simple.JSONObject", () -> { return new JsonSimpleConfigParser(); });
5060

5161
private final String className;
52-
private final Supplier<ConfigParser> supplier;
62+
private final ParserSupplier supplier;
5363

54-
ConfigParserSupplier(String className, Supplier<ConfigParser> supplier) {
64+
ConfigParserSupplier(String className, ParserSupplier supplier) {
5565
this.className = className;
5666
this.supplier = supplier;
5767
}

0 commit comments

Comments
 (0)
Please sign in to comment.