From c7c5b10c41ef240e93872acb02c500eb0eb8d858 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 24 May 2020 13:11:50 +0200 Subject: [PATCH] Bump MiniDNS version to 0.4.0-alpha5 --- build.gradle | 2 +- .../tcp/rce/IpTcpRemoteConnectionEndpoint.java | 18 ++++-------------- .../rce/RemoteXmppTcpConnectionEndpoints.java | 6 +++--- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index cdf05eef4..e9b0d9b11 100644 --- a/build.gradle +++ b/build.gradle @@ -123,7 +123,7 @@ allprojects { // - https://issues.apache.org/jira/browse/MNG-6232 // - https://issues.igniterealtime.org/browse/SMACK-858 jxmppVersion = '0.7.0-alpha5' - miniDnsVersion = '0.4.0-alpha3' + miniDnsVersion = '0.4.0-alpha5' smackMinAndroidSdk = 19 junitVersion = '5.6.0' commonsIoVersion = '2.6' diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/IpTcpRemoteConnectionEndpoint.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/IpTcpRemoteConnectionEndpoint.java index 713509800..5f6a23ad5 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/IpTcpRemoteConnectionEndpoint.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/IpTcpRemoteConnectionEndpoint.java @@ -16,18 +16,14 @@ */ package org.jivesoftware.smack.tcp.rce; -import java.net.Inet4Address; -import java.net.Inet6Address; import java.net.InetAddress; import org.jivesoftware.smack.datatypes.UInt16; import org.jivesoftware.smack.util.rce.SingleAddressRemoteConnectionEndpoint; -import org.minidns.record.A; -import org.minidns.record.AAAA; import org.minidns.record.InternetAddressRR; -public final class IpTcpRemoteConnectionEndpoint +public final class IpTcpRemoteConnectionEndpoint> implements Rfc6120TcpRemoteConnectionEndpoint, SingleAddressRemoteConnectionEndpoint { private final CharSequence host; @@ -42,17 +38,11 @@ public final class IpTcpRemoteConnectionEndpoint this.internetAddressResourceRecord = internetAddressResourceRecord; } - public static IpTcpRemoteConnectionEndpoint from(CharSequence host, UInt16 port, + public static IpTcpRemoteConnectionEndpoint> from(CharSequence host, UInt16 port, InetAddress inetAddress) { - InternetAddressRR internetAddressResourceRecord; - // TODO: Use InternetAddressRR.from(InetAddress) once MiniDNS is updated. - if (inetAddress instanceof Inet4Address) { - internetAddressResourceRecord = new A((Inet4Address) inetAddress); - } else { - internetAddressResourceRecord = new AAAA((Inet6Address) inetAddress); - } + InternetAddressRR internetAddressResourceRecord = InternetAddressRR.from(inetAddress); - return new IpTcpRemoteConnectionEndpoint(host, port, + return new IpTcpRemoteConnectionEndpoint>(host, port, internetAddressResourceRecord); } diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java index cf5ce3e25..6b7da5ccf 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/rce/RemoteXmppTcpConnectionEndpoints.java @@ -62,7 +62,7 @@ public class RemoteXmppTcpConnectionEndpoints { if (hostAddress != null) { lookupFailures = Collections.emptyList(); - IpTcpRemoteConnectionEndpoint connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( + IpTcpRemoteConnectionEndpoint> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( hostAddress.toString(), config.getPort(), hostAddress); discoveredRemoteConnectionEndpoints = Collections.singletonList(connectionEndpoint); } else if (host != null) { @@ -75,7 +75,7 @@ public class RemoteXmppTcpConnectionEndpoints { discoveredRemoteConnectionEndpoints = new ArrayList<>(hostAddresses.size()); UInt16 port = config.getPort(); for (InetAddress inetAddress : hostAddresses) { - IpTcpRemoteConnectionEndpoint connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( + IpTcpRemoteConnectionEndpoint> connectionEndpoint = IpTcpRemoteConnectionEndpoint.from( host, port, inetAddress); discoveredRemoteConnectionEndpoints.add(connectionEndpoint); } @@ -215,7 +215,7 @@ public class RemoteXmppTcpConnectionEndpoints { List hostAddresses = dnsResolver.lookupHostAddress(domain, lookupFailures, dnssecMode); if (hostAddresses != null) { for (InetAddress inetAddress : hostAddresses) { - IpTcpRemoteConnectionEndpoint endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress); + IpTcpRemoteConnectionEndpoint> endpoint = IpTcpRemoteConnectionEndpoint.from(domain, defaultPort, inetAddress); endpoints.add(endpoint); } }