So I'm getting the following error in eclipse and I am not understanding what is the problem:
ERROR:
Cannot refer to the non-final local variable minActiveDutyCycles defined in an enclosing scope
The code minActiveDutyCycles[i++];
on line B is underlined with red
for code:
double[] minActiveDutyCycles = c.getMinActiveDutyCycles(); // LINE A <==== WHY DOES THIS VARIABLE NEED TO BE FINAL for code at LINE B???
ArrayUtils.setIndexesTo(boostInterim, ArrayUtils.where(activeDutyCycles, new Condition.Adapter<Object>() {
int i = 0;
@Override public boolean eval(double d) { return d > minActiveDutyCycles[i++]; } // LINE B
}), 1.0d);