michael-o commented on code in PR #315:
URL: https://github.com/apache/maven-resolver/pull/315#discussion_r1252670683
##########
maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java:
##########
@@ -295,6 +300,20 @@ final class HttpTransporter extends AbstractTransporter {
this.client = builder.build();
}
+ private InetAddress getBindAddress(RepositorySystemSession session) {
+ String bindAddress = ConfigUtils.getString(session, null,
BIND_ADDRESS);
+ return
Optional.ofNullable(bindAddress).map(this::resolveAddressOrNull).orElse(null);
+ }
+
+ private InetAddress resolveAddressOrNull(String bindAddress) {
+ try {
+ return InetAddress.getByName(bindAddress);
+ } catch (UnknownHostException uhe) {
+ LOGGER.warn("Given bind address (" + bindAddress + ") cannot be
resolved. Reverting to default route.");
Review Comment:
Shouldn't this really fail with IAE? I mean, if you provide invalid values
the system should fail no? If you want default, don't provide it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]