Java
'assert' statement with side effects
Warning
New
Last modified: 03 December 2024 Reports assert
statements that cause side effects.
Since assertions can be switched off, these side effects are not guaranteed, which can cause subtle bugs. Common unwanted side effects detected by this inspection are modifications of variables and fields. When methods calls are involved, they are analyzed one level deep.
Example:
assert i++ < 10;
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
AssertWithSideEffects
This inspection depends on the Java feature 'Assertions', which is available since Java 1.4.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!
Was this page helpful?