/** * Normalizes the port on the provided URI. If no port was specified directly, the default port for the URI's * scheme is returned instead. * * @param uri the URI to normalize the port for * @return the normalized port, or -1 if no default port is available for the URI's scheme * @see com.atlassian.applinks.core.util.RequestUtil#getDefaultPort(String) */ private int normalizePort(URI uri) { int port = uri.getPort(); if (port == -1) { port = RequestUtil.getDefaultPort(uri.getScheme()); } return port; } }