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

    https://github.com/apache/flink/pull/4121#discussion_r122633648
  
    --- Diff: 
flink-libraries/flink-cep/src/main/java/org/apache/flink/cep/pattern/Pattern.java
 ---
    @@ -318,7 +319,30 @@ public Quantifier getQuantifier() {
                checkIfQuantifierApplied();
                Preconditions.checkArgument(times > 0, "You should give a 
positive number greater than 0.");
                this.quantifier = 
Quantifier.times(quantifier.getConsumingStrategy());
    -           this.times = times;
    +           this.times = Times.of(times);
    +           return this;
    +   }
    +
    +   /**
    +    * Specifies that the pattern can occur between from and to times.
    +    *
    +    * @param from number of times matching event must appear at least
    +    * @param to number of times matching event must appear at most
    +    * @return The same pattern with the number of times range applied
    +    *
    +    * @throws MalformedPatternException if the quantifier is not 
applicable to this pattern.
    +    */
    +   public Pattern<T, F> times(int from, int to) {
    +           checkIfNoNotPattern();
    +           checkIfQuantifierApplied();
    +           Preconditions.checkArgument(from >= 0, "The from should be a 
non-negative number greater than or equal to 0.");
    --- End diff --
    
    It is already checked in `Times` class. Maybe remove those checks from here?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to