File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
core-api/src/main/java/com/optimizely/ab/config/parser Expand file tree Collapse file tree 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() {
4040 //======== Helper methods ========//
4141
4242 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 (); });
4750
4851 private final String className ;
4952 private final Supplier <ConfigParser > supplier ;
You can’t perform that action at this time.
0 commit comments