This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 6dcbb900fb Replace calls to methods that are deprecated in Java 16+
6dcbb900fb is described below

commit 6dcbb900fb80c42a8b4fd0fcf5b8947651f907d9
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jan 12 19:57:09 2023 +0000

    Replace calls to methods that are deprecated in Java 16+
---
 test/org/apache/catalina/tribes/TesterMulticast.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/catalina/tribes/TesterMulticast.java 
b/test/org/apache/catalina/tribes/TesterMulticast.java
index 32227525c8..866d50ed30 100644
--- a/test/org/apache/catalina/tribes/TesterMulticast.java
+++ b/test/org/apache/catalina/tribes/TesterMulticast.java
@@ -19,6 +19,7 @@ package org.apache.catalina.tribes;
 import java.net.DatagramPacket;
 import java.net.InetAddress;
 import java.net.MulticastSocket;
+import java.net.NetworkInterface;
 import java.net.UnknownHostException;
 
 /**
@@ -81,7 +82,8 @@ public class TesterMulticast {
         public void run() {
             try (MulticastSocket s = new MulticastSocket(PORT)) {
                 s.setLoopbackMode(false);
-                s.joinGroup(INET_ADDRESS);
+                NetworkInterface networkInterface = 
NetworkInterface.getByInetAddress(INET_ADDRESS);
+                s.setNetworkInterface(networkInterface);
                 DatagramPacket p = new DatagramPacket(new byte[4], 4);
                 p.setAddress(INET_ADDRESS);
                 p.setPort(PORT);
@@ -108,7 +110,8 @@ public class TesterMulticast {
         public void run() {
             try (MulticastSocket s = new MulticastSocket(PORT)) {
                 s.setLoopbackMode(false);
-                s.joinGroup(INET_ADDRESS);
+                NetworkInterface networkInterface = 
NetworkInterface.getByInetAddress(INET_ADDRESS);
+                s.setNetworkInterface(networkInterface);
                 DatagramPacket p = new DatagramPacket(new byte[4], 4);
                 p.setAddress(INET_ADDRESS);
                 p.setPort(PORT);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to