Inspectopedia
 
2024.3

Assertion can be replaced with 'if' statement

Info
New
Last modified: 03 December 2024

Reports assert statements and suggests replacing them with if statements that throw java.lang.AssertionError.

Example:

After the quick-fix is applied:

This inspection depends on the Java feature 'Assertions', which is available since Java 1.4.