j-easy / easy-rules

The simple, stupid rules engine for Java
https://github.com/j-easy/easy-rules/wiki
MIT License
4.83k stars 1.04k forks source link

there is a logic error in the class NonFizzBuzzRule of Tutorials "Fizz Buzz" #417

Open jony0113 opened 9 months ago

jony0113 commented 9 months ago

@Condition public boolean isNotFizzNorBuzz(@Fact("number") Integer number) { // can return true, because this is the latest rule to trigger according to assigned priorities // and in which case, the number is not fizz nor buzz return number % 5 != 0 || number % 7 != 0; }

should be

return number % 5 != 0 && number % 7 != 0