code: public static int parsePort(final String address) {
          int sp = address.indexOf(":");
          if (sp == -1 && sp + 1 >= address.length()) {
              throw new IllegalArgumentException("not found port '" + address + "'");
          }
  
          try {
              return Integer.parseInt(address.substring(sp + 1, address.length()).trim());
          } catch (NumberFormatException nfe) {
              throw new IllegalArgumentException("bad port number '" + address + "'");
          }
      }
docs: Parses the port.
  
  @param address the address
  @return the int