@ VisibleForTesting static String makeTargetStringForDirectAddress ( SocketAddress address ) { try { return new URI ( DIRECT_ADDRESS_SCHEME , "" , "/" + address , null ) . toString ( ) ; } catch ( URISyntaxException e ) { // It should not happen. throw new RuntimeException ( e ) ; } }
Returns a target string for the SocketAddress . It is only used as a placeholder because DirectAddressNameResolverFactory will not actually try to use it . However it must be a valid URI .