On Tue, Aug 23, 2011 at 7:13 PM, Jörn Kottmann <[email protected]> wrote:
> 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 > I see. I will have to do the same in each CV tool because there we also keep a copy of the monitors array.
