test_class.file: util/src/test/java/com/google/cloud/hadoop/util/HttpTransportFactoryTest.java
test_class.identifier: HttpTransportFactoryTest
test_case.body: @Test
    public void testParseProxyAddressNoHost() throws Exception {
      String address = ":1234";
  
      IllegalArgumentException thrown =
          assertThrows(
              IllegalArgumentException.class, () -> HttpTransportFactory.parseProxyAddress(address));
      assertThat(thrown).hasMessageThat().contains("Proxy address ':1234' has no host.");
    }
test_case.class_method_signature: HttpTransportFactoryTest.testParseProxyAddressNoHost()
test_case.full_signature: @Test public void testParseProxyAddressNoHost()
test_case.identifier: testParseProxyAddressNoHost
test_case.invocations: assertThrows parseProxyAddress contains hasMessageThat assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseProxyAddressNoHost()
focal_class.declarator: logger = GoogleLogger.forEnclosingClass()
focal_class.modifier: private static final
focal_class.original_string: private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();
focal_class.type: GoogleLogger
focal_class.var_name: logger
focal_class.declarator: DEFAULT_TRANSPORT_TYPE = HttpTransportType.JAVA_NET
focal_class.modifier: public static final
focal_class.original_string: public static final HttpTransportType DEFAULT_TRANSPORT_TYPE = HttpTransportType.JAVA_NET;
focal_class.type: HttpTransportType
focal_class.var_name: DEFAULT_TRANSPORT_TYPE
focal_class.file: util/src/main/java/com/google/cloud/hadoop/util/HttpTransportFactory.java
focal_class.identifier: HttpTransportFactory
focal_class.class_method_signature: HttpTransportFactory.createHttpTransport(HttpTransportType type)
focal_class.full_signature: public static HttpTransport createHttpTransport(HttpTransportType type)
focal_class.identifier: createHttpTransport
focal_class.modifiers: public static
focal_class.parameters: (HttpTransportType type)
focal_class.return: HttpTransport
focal_class.signature: HttpTransport createHttpTransport(HttpTransportType type)
focal_class.class_method_signature: HttpTransportFactory.createHttpTransport(
        HttpTransportType type,
        @Nullable String proxyAddress,
        @Nullable RedactedString proxyUsername,
        @Nullable RedactedString proxyPassword)
focal_class.full_signature: public static HttpTransport createHttpTransport(
        HttpTransportType type,
        @Nullable String proxyAddress,
        @Nullable RedactedString proxyUsername,
        @Nullable RedactedString proxyPassword)
focal_class.identifier: createHttpTransport
focal_class.modifiers: public static
focal_class.parameters: (
        HttpTransportType type,
        @Nullable String proxyAddress,
        @Nullable RedactedString proxyUsername,
        @Nullable RedactedString proxyPassword)
focal_class.return: HttpTransport
focal_class.signature: HttpTransport createHttpTransport(
        HttpTransportType type,
        @Nullable String proxyAddress,
        @Nullable RedactedString proxyUsername,
        @Nullable RedactedString proxyPassword)
focal_class.class_method_signature: HttpTransportFactory.createApacheHttpTransport(
        @Nullable URI proxyUri, @Nullable Credentials proxyCredentials)
focal_class.full_signature: public static ApacheHttpTransport createApacheHttpTransport(
        @Nullable URI proxyUri, @Nullable Credentials proxyCredentials)
focal_class.identifier: createApacheHttpTransport
focal_class.modifiers: public static
focal_class.parameters: (
        @Nullable URI proxyUri, @Nullable Credentials proxyCredentials)
focal_class.return: ApacheHttpTransport
focal_class.signature: ApacheHttpTransport createApacheHttpTransport(
        @Nullable URI proxyUri, @Nullable Credentials proxyCredentials)
focal_class.class_method_signature: HttpTransportFactory.createNetHttpTransport(
        @Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth)
focal_class.full_signature: public static NetHttpTransport createNetHttpTransport(
        @Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth)
focal_class.identifier: createNetHttpTransport
focal_class.modifiers: public static
focal_class.parameters: (
        @Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth)
focal_class.return: NetHttpTransport
focal_class.signature: NetHttpTransport createNetHttpTransport(
        @Nullable URI proxyUri, @Nullable PasswordAuthentication proxyAuth)
focal_class.class_method_signature: HttpTransportFactory.parseProxyAddress(@Nullable String proxyAddress)
focal_class.full_signature: @VisibleForTesting static URI parseProxyAddress(@Nullable String proxyAddress)
focal_class.identifier: parseProxyAddress
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (@Nullable String proxyAddress)
focal_class.return: URI
focal_class.signature: URI parseProxyAddress(@Nullable String proxyAddress)
focal_method.body: @VisibleForTesting
    static URI parseProxyAddress(@Nullable String proxyAddress) {
      if (Strings.isNullOrEmpty(proxyAddress)) {
        return null;
      }
      String uriString = (proxyAddress.contains("//") ? "" : "//") + proxyAddress;
      try {
        URI uri = new URI(uriString);
        String scheme = uri.getScheme();
        String host = uri.getHost();
        int port = uri.getPort();
        checkArgument(
            Strings.isNullOrEmpty(scheme) || scheme.matches("https?"),
            "HTTP proxy address '%s' has invalid scheme '%s'.", proxyAddress, scheme);
        checkArgument(!Strings.isNullOrEmpty(host), "Proxy address '%s' has no host.", proxyAddress);
        checkArgument(port != -1, "Proxy address '%s' has no port.", proxyAddress);
        checkArgument(
            uri.equals(new URI(scheme, null, host, port, null, null, null)),
            "Invalid proxy address '%s'.", proxyAddress);
        return uri;
      } catch (URISyntaxException e) {
        throw new IllegalArgumentException(
            String.format("Invalid proxy address '%s'.", proxyAddress), e);
      }
    }
focal_method.class_method_signature: HttpTransportFactory.parseProxyAddress(@Nullable String proxyAddress)
focal_method.full_signature: @VisibleForTesting static URI parseProxyAddress(@Nullable String proxyAddress)
focal_method.identifier: parseProxyAddress
focal_method.invocations: isNullOrEmpty contains getScheme getHost getPort checkArgument isNullOrEmpty matches checkArgument isNullOrEmpty checkArgument checkArgument equals format
focal_method.modifiers: @VisibleForTesting static
focal_method.parameters: (@Nullable String proxyAddress)
focal_method.return: URI
focal_method.signature: URI parseProxyAddress(@Nullable String proxyAddress)