Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/224#discussion_r104566230
  
    --- Diff: 
core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java ---
    @@ -117,6 +121,7 @@ String getFormatDescription() {
        * @return true if value is valid or null, or if this type has no regex
        */
       public boolean isValidFormat(String value) {
    +    Preconditions.checkState(predicate != null, "Predicate was null, maybe 
this enum was serialized????");
    --- End diff --
    
    Enums are inherently java-serializable. This cannot be prevented. What this 
is trying to work around (in conjunction with the predicate being transient) is 
that the predicates (especially the lambdas?) are not themselves serializable 
and cannot necessarily be included with the enum. If, for whatever reason, 
these enums ever get serialized, and then deserialized, we won't necessarily be 
able to call the `isValidFormat` function on them.
    
    I'm not sure if this can even ever happen. I would expect enums to have 
one, and only one, instance in the JVM ever.... the one created by the 
constructor... not the one produced by deserializing. So, this might not ever 
be able to happen... but it'd be interesting to see if it did.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to