protected synchronized void bind(UDPDatagramSocketImpl socket) throws SocketException { final Integer lport = new Integer(socket.getLocalPort()); if (sockets.containsKey(lport)) { throw new SocketException("Port already bound (" + lport + ")"); } else { sockets.put(lport, socket);
protected synchronized void bind(UDPDatagramSocketImpl socket) throws SocketException { Integer lport = new Integer(socket.getLocalPort());  if (lport.compareTo(zero) != 0 && sockets.containsKey(lport)) { throw new SocketException("Port already bound (" + lport + ")"); } else { Integer ran;  while (lport.compareTo(zero) == 0) { ran = new Integer(random.nextInt(stopRandom) + startRandom);  if (!sockets.containsKey(ran)) { lport = ran; socket.setLocalPort(lport.intValue());
    protected synchronized void bind(UDPDatagramSocketImpl socket)            throws SocketException {        final Integer lport = new Integer(socket.getLocalPort());        if (sockets.containsKey(lport)) {            throw new SocketException("Port already bound (" + lport + ")");        } else {            sockets.put(lport, socket);        }    }