Skip to content

ProxyConfiguration.toBuilder throws NullPointerException #2884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mosche opened this issue Dec 3, 2021 · 2 comments · Fixed by #2907
Closed

ProxyConfiguration.toBuilder throws NullPointerException #2884

mosche opened this issue Dec 3, 2021 · 2 comments · Fixed by #2907
Labels
bug This issue is a bug.

Comments

@mosche
Copy link

mosche commented Dec 3, 2021

Describe the bug

ProxyConfiguration.toBuilder throws NullPointerException if nonProxyHosts is unset:

java.lang.NullPointerException
	at java.util.HashSet.<init>(HashSet.java:119)
	at software.amazon.awssdk.http.apache.ProxyConfiguration$DefaultClientProxyConfigurationBuilder.nonProxyHosts(ProxyConfiguration.java:368)
	at software.amazon.awssdk.http.apache.ProxyConfiguration.toBuilder(ProxyConfiguration.java:163)

The problematic code this:

        @Override
        public Builder nonProxyHosts(Set<String> nonProxyHosts) {
            this.nonProxyHosts = new HashSet<>(nonProxyHosts);
            return this;
        }

Expected behavior

ProxyConfiguration.toBuilder should work on any possible ProxyConfiguration.

Current behavior

Throws exception

Steps to Reproduce

    ProxyConfiguration proxyConfiguration =
        ProxyConfiguration.builder()
            .endpoint(URI.create("http://localhost:8080"))
            .username("username")
            .password("password")
            .build();
    proxyConfiguration.toBuilder();

Possible Solution

No response

Context

No response

AWS Java SDK version used

Latest

JDK version used

1.8

Operating System and version

@mosche mosche added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 3, 2021
@debora-ito
Copy link
Member

Thank you for reporting this @mosche. We'll fix it.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
2 participants