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

    https://github.com/apache/incubator-metron/pull/119#discussion_r63111447
  
    --- Diff: 
metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateProcessor.java
 ---
    @@ -18,12 +18,20 @@
     
     package org.apache.metron.common.query;
     
    -import org.antlr.v4.runtime.*;
    -import org.apache.metron.common.query.generated.*;
    +import org.antlr.v4.runtime.ANTLRInputStream;
    +import org.antlr.v4.runtime.CommonTokenStream;
    +import org.antlr.v4.runtime.TokenStream;
    +import org.apache.metron.common.query.generated.PredicateLexer;
    +import org.apache.metron.common.query.generated.PredicateParser;
    +
    +import static org.apache.commons.lang3.StringUtils.isEmpty;
     
     
     public class PredicateProcessor {
       public boolean parse(String rule, VariableResolver resolver) {
    +    if (isEmpty(rule)) {
    --- End diff --
    
    That works. || or && are equivalent in this situation
    On Thu, May 12, 2016 at 18:56 Michael Miklavcic <[email protected]>
    wrote:
    
    > In
    > 
metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateProcessor.java
    > <https://github.com/apache/incubator-metron/pull/119#discussion_r63111019>
    > :
    >
    > >
    > >
    > >  public class PredicateProcessor {
    > >    public boolean parse(String rule, VariableResolver resolver) {
    > > +    if (isEmpty(rule)) {
    >
    > On second thought, what about rule == null || isEmpty(rule.trim())? I
    > can't think of a reason to handle null different from "" or " ". The trim
    > would only be evaluated if rule != null, and now we're also covering the
    > null condition. Thoughts?
    >
    > —
    > You are receiving this because you commented.
    > Reply to this email directly or view it on GitHub
    > 
<https://github.com/apache/incubator-metron/pull/119/files/b3af68484718a66393f4b0417bc525c462afed5d#r63111019>
    >



---
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