ctubbsii commented on code in PR #3927:
URL: https://github.com/apache/accumulo/pull/3927#discussion_r1391733230
##########
core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java:
##########
@@ -136,6 +141,9 @@ public enum PropertyType {
"An arbitrary string of characters whose format is unspecified and"
+ " interpreted based on the context of the property to which it
applies."),
+ JSON("json", x -> new ValidJson().test(x),
Review Comment:
It doesn't make sense to make the object mapper static, and instantiate the
ValidJson object each time in order to call it's test method. It's already a
Predicate, so you don't need the `x -> ... .test(x)` stuff, you can just do:
```suggestion
JSON("json", ValidJson::new,
```
Then, you don't have to worry about making the object mapper a static
singleton... the PropertyType.JSON enum will just re-use the singleton
`ValidJson::new` instance passed in for its predicate every time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]