if (lexer.hasMoreChars() && lexer.lookAhead(0) == ':') { lexer.consume(1); lexer.SPorHT(); try { String port = lexer.number(); hp.setPort(Integer.parseInt(port)); } catch (NumberFormatException nfe) { throw new ParseException( lexer.getBuffer() + " :Error parsing port ", lexer.getPtr());
if (lexer.hasMoreChars()) { switch (lexer.lookAhead(0)) { case ':': lexer.consume(1); lexer.SPorHT(); try { String port = lexer.number(); hp.setPort(Integer.parseInt(port)); } catch (NumberFormatException nfe) { throw new ParseException( lexer.getBuffer() + " :Error parsing port ", lexer.getPtr()); } break;  case ';': case '?': case '>': case ' ': case '\t': case '\r': case '\n': break;  default: throw new ParseException( lexer.getBuffer() + " Illegal character in hostname:" + lexer.lookAhead(0), lexer.getPtr() );
	public HostPort hostPort() throws ParseException {		if (debug)			dbg_enter("hostPort");		try {			Host host = this.host();			HostPort hp = new HostPort();			hp.setHost(host);			// Has a port?			lexer.SPorHT(); // white space before ":port" should be accepted			if (lexer.hasMoreChars() && lexer.lookAhead(0) == ':') {				lexer.consume(1);				lexer.SPorHT(); // white space before port number should be accepted				try {					String port = lexer.number();					hp.setPort(Integer.parseInt(port));				} catch (NumberFormatException nfe) {					throw new ParseException(						lexer.getBuffer() + " :Error parsing port ",						lexer.getPtr());				}			}			return hp;		} finally {			if (debug)				dbg_leave("hostPort");		}	}