[java S5413] FP when followed by break/return

Qube: Community 9.9

The Java rule S5413 reports a FP, if the call to list.remove() is followed by break or return (more or less directly).

Example:

List<String> list = ...;

for (int i = 0; i < list.size(); i++)
{
    if (i == 3)
    {
        list.remove(i); // FP
        return;
    }
}

Hey there.

Thanks for the report. It has been previously reported and tracked here: SONARJAVA-4414