-
Notifications
You must be signed in to change notification settings - Fork 627
Closed
Description
Relevant code:
double y = Double.NaN
while (Double.isNaN(y) && someOtherCondition) {
...
y = Double.parseDouble(...);
...
}
Reported:
FL_FLOATS_AS_LOOP_COUNTERS: Do not use floating-point variables as loop counters
Using floating-point variables should not be used as loop counters, as they are not precise, which may result in incorrect loops. A loop counter is a variable that is changed with each iteration and controls when the loop should terminate. It is decreased or increased by a fixed amount each iteration.
See rule NUM09-J.
However, there is no fixed increment, so I think it does not apply here.
Bytecode:
FollowTarget.zip
Metadata
Metadata
Assignees
Labels
No labels