Small mistake in precondition check example
See original GitHub issuecheckArgument(i < j, "Expected i < j, but %s > %s", i, j);
should be
checkArgument(i < j, "Expected i < j, but %s >= %s", i, j);
😉 🤓
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to track down "precondition failure: attribute failed to set ...
I recently see sometimes crashing errors with statements like "precondition failure: attribute failed to set an initial value: 103" logged to the console....
Read more >Best way to handle a typical precondition exception?
Note: The File existence check is just an example of a precondition to HANDLE. Clearly, there is a good case for letting File...
Read more >Reasoning About Code, Part 1 - Williams College
A precondition is an assertion inserted prior to execution, and a postcondition is an assertion inserted after execution. In the example above, ...
Read more >Pattern for costly precondition check before acting
Use the first example whenever possible. This way it's near impossible to forget the check or to forget to handle the error.
Read more >Preconditions — Part I | Andrzej's C++ blog - WordPress.com
Violating a precondition is conceptually similar to dereferencing a null pointer. A function simply works under the assumption that certain ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Aaa whoops, sorry 🙇
https://github.com/google/guava/wiki/PreconditionsExplained
I’ve fixed it. Thanks for the catch! 😃