On 8/23/11 7:06 PM, [email protected] wrote:
    public Evaluator(EvaluationMonitor<T>... listeners) {
-    if(listeners != null) {
-      this.listeners = Arrays.asList(listeners);
-    }
+    this.listeners = listeners;
    }

We again need to make a copy here, because an array would just be
passed by its reference and can be modified afterwards by the caller.
Because of that the Evaluator object cannot encapsulate it.

Maybe just keep the old list, and copy it into it. Usually you would
do an array copy, but that is not possible without a warning here ...

Jörn

Reply via email to