Class<? extends AlignCalcWorkerI> workerClass)
{
List<AlignCalcWorkerI> workingClass = new ArrayList<AlignCalcWorkerI>();
+ AlignCalcWorkerI[] workers;
synchronized (canUpdate)
{
- for (AlignCalcWorkerI worker : canUpdate)
+ workers = canUpdate.toArray(new AlignCalcWorkerI[0]);
+ }
+ for (AlignCalcWorkerI worker : workers)
+ {
+ if (workerClass.equals(worker.getClass()))
{
- if (workerClass.equals(worker.getClass()))
- {
- workingClass.add(worker);
- }
+ workingClass.add(worker);
}
}
return (workingClass.size() == 0) ? null : workingClass;