/** * Sets a modifiable list of server connectors. Method synchronized to make * compound action (clear, addAll) atomic, not for visibility. * * @param servers * A modifiable list of server connectors. */ public synchronized void setServers(ServerList servers) { this.servers.clear(); if (servers != null) { this.servers.addAll(servers); } }
/** * Sets the modifiable list of server connectors. This method clears the * current list and adds all entries in the parameter list. * * @param servers * A list of server connectors. */ public void setServers(ServerList servers) { synchronized (getServers()) { if (servers != getServers()) { getServers().clear(); if (servers != null) { getServers().addAll(servers); } } } }