org.sonar.l10n.java.rules.squid.S3346.html Maven / Gradle / Ivy
Since assert
statements aren't executed by default (they must be enabled with JVM flags) developers should never rely on their execution the evaluation of any logic required for correct program function.
Noncompliant Code Example
assert myList.remove(myList.get(0)); // Noncompliant
Compliant Solution
boolean removed = myList.remove(myList.get(0));
assert removed;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy