Why is this an issue?

When iterating over any collection, fetch the size of the collection in advance to avoid fetching it on each iteration. This saves CPU cycles, and therefore consumes less power.

Examples

Noncompliant

List<String> objList = getData();

for (int i = 0; i < objList.size(); i++) {  // Noncompliant
    // execute code
}

Compliant

List<String> objList = getData();

int size = objList.size();
for (int i = 0; i < size; i++) {
    // execute code
}