DockerClientConfig.DockerClientConfigBuilder.build() is defined as:
public DockerClientConfig build() {
return new DockerClientConfig(
uri,
version,
username,
password,
email,
serverAddress,
dockerCfgPath,
readTimeout,
loggingFilterEnabled,
sslConfig,
maxTotalConnections,
maxPerRouteConnections
);
}
The last two parameters are of type Integer, and they can be NULL, no where in the API says they can't be NULL, and no where says DockerClientConfigBuilder.withMaxTotalConnections() or DockerClientConfigBuilder.withMaxPerRouteConnections() has to be called.
There are no default values set for these two parameters either.
If the caller never set these two fields, when DockerClientConfig is created inside of this build function, because DockerClientConfig() expects maxTotalConnections and maxPerRouteConnections to be passed in as primitive int type, it will cause NullPointerException.
Either a meaningful error message or exception should be thrown here, or the code here should use some reasonable default values
DockerClientConfig.DockerClientConfigBuilder.build() is defined as:
The last two parameters are of type Integer, and they can be NULL, no where in the API says they can't be NULL, and no where says DockerClientConfigBuilder.withMaxTotalConnections() or DockerClientConfigBuilder.withMaxPerRouteConnections() has to be called.
There are no default values set for these two parameters either.
If the caller never set these two fields, when DockerClientConfig is created inside of this build function, because DockerClientConfig() expects maxTotalConnections and maxPerRouteConnections to be passed in as primitive int type, it will cause NullPointerException.
Either a meaningful error message or exception should be thrown here, or the code here should use some reasonable default values