You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

from fortifysoftware:

ABSTRACT

This statement will never be executed.
EXPLANATION

The surrounding code makes it impossible for this statement to ever be executed.

Example: The condition for the second if statement is impossible to satisfy. It requires that the variable s be non-null, while on the only path where s can be assigned a non-null value there is a return statement.

String s = null;

if (b) {
s = "Yes";
return;
}

if (s != null) {
Dead();
}

  • No labels