activate icon indicating copy to clipboard operation
activate copied to clipboard

invariant statement executed twice when false

Open ThijsBroersen opened this issue 10 years ago • 3 comments

Hi Flavio,

I found out that when an invariant statement outputs false it is immediately executed again before throwing the InvariantViolationException. Is this correct?

Kind regards, Thijs

ThijsBroersen avatar Jul 28 '14 07:07 ThijsBroersen

This is the expected behavior, since the validation is done in more than one phase. Is it affecting your application's behavior?

fwbrasil avatar Jul 28 '14 18:07 fwbrasil

Thanks for the reply! It is not affecting my application's behavior too much, but I noticed it in my debug-logging and I do not see the logic: each executing gives the same result so why is there more than one validation phase?

ThijsBroersen avatar Jul 28 '14 19:07 ThijsBroersen

Yeah, there is space for optimizations for the invariants. Lets keep this issue open to review the invariant validation phases.

fwbrasil avatar Jul 28 '14 21:07 fwbrasil