ProxyPlugin[] plugins = new ProxyPlugin[_plugins.size()]; plugins = (ProxyPlugin[]) _plugins.toArray(plugins); Listener l = new Listener(_plug, address, port, base, netsim, usePlugins ? plugins : null);
Listener l = new Listener(_plug, address, port, base, netsim, usePlugins ? _plugins : null);
    public String startProxy(String address, int port, String base, String simulator, boolean usePlugins) throws IOException {        String key = address + ":" + port;            if (base != null && base.equals("")) {                base = null;            }            if (simulator == null || simulator.trim().equals("") || !_simulators.containsKey(simulator)) {                simulator = "Unlimited";            }            NetworkSimulator netsim = (NetworkSimulator) _simulators.get(simulator);            ProxyPlugin[] plugins = new ProxyPlugin[_plugins.size()];            plugins = (ProxyPlugin[]) _plugins.toArray(plugins);            Listener l = new Listener(_plug, address, port, base, netsim, usePlugins ? plugins : null);            _listeners.put(key,l);                        _prop.setProperty("Proxy.listener." + key + ".base", base == null ? "" : base);            _prop.setProperty("Proxy.listener." + key + ".useplugins", usePlugins == true ? "yes" : "no");            _prop.setProperty("Proxy.listener." + key + ".simulator", simulator);                        String value = null;            Iterator i = _listeners.keySet().iterator();            while (i.hasNext()) {                key = (String) i.next();                if (value == null) {                    value = key;                } else {                    value = value + ", " + key;                }            }            _prop.setProperty("Proxy.listeners", value);            return key;    }