File tree 1 file changed +7
-4
lines changed
core-api/src/main/java/com/optimizely/ab/config/parser
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,13 @@ public static ConfigParser getInstance() {
40
40
//======== Helper methods ========//
41
41
42
42
public enum ConfigParserSupplier {
43
- GSON_CONFIG_PARSER ("com.google.gson.Gson" , GsonConfigParser ::new ),
44
- JACKSON_CONFIG_PARSER ("com.fasterxml.jackson.databind.ObjectMapper" , JacksonConfigParser ::new ),
45
- JSON_CONFIG_PARSER ("org.json.JSONObject" , JsonConfigParser ::new ),
46
- JSON_SIMPLE_CONFIG_PARSER ("org.json.simple.JSONObject" , JsonSimpleConfigParser ::new );
43
+ // WARNING THESE MUST REMAIN LAMBDAS!!!
44
+ // SWITCHING TO METHOD REFERENCES REQUIRES REQUIRES
45
+ // ALL PARSERS IN THE CLASSPATH.
46
+ GSON_CONFIG_PARSER ("com.google.gson.Gson" , () -> { return new GsonConfigParser (); }),
47
+ JACKSON_CONFIG_PARSER ("com.fasterxml.jackson.databind.ObjectMapper" , () -> { return new JacksonConfigParser (); }),
48
+ JSON_CONFIG_PARSER ("org.json.JSONObject" , () -> { return new JsonConfigParser (); }),
49
+ JSON_SIMPLE_CONFIG_PARSER ("org.json.simple.JSONObject" , () -> { return new JsonSimpleConfigParser (); });
47
50
48
51
private final String className ;
49
52
private final Supplier <ConfigParser > supplier ;
You can’t perform that action at this time.
0 commit comments