ralf0131 commented on a change in pull request #2079: [Dubbo-2064] Ipv6 support
URL: https://github.com/apache/incubator-dubbo/pull/2079#discussion_r206804449
 
 

 ##########
 File path: 
dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
 ##########
 @@ -194,26 +194,22 @@ private static InetAddress getLocalAddress0() {
         }
         try {
             Enumeration<NetworkInterface> interfaces = 
NetworkInterface.getNetworkInterfaces();
-            if (interfaces != null) {
-                while (interfaces.hasMoreElements()) {
-                    try {
-                        NetworkInterface network = interfaces.nextElement();
-                        Enumeration<InetAddress> addresses = 
network.getInetAddresses();
-                        if (addresses != null) {
-                            while (addresses.hasMoreElements()) {
-                                try {
-                                    InetAddress address = 
addresses.nextElement();
-                                    if (isValidAddress(address)) {
-                                        return address;
-                                    }
-                                } catch (Throwable e) {
-                                    logger.warn(e);
-                                }
+            while (interfaces.hasMoreElements()) {
 
 Review comment:
   Thanks, I am using Java 10, the implementation is different with Java 8. In 
Java 10 the implementation guarantees no null value is returned. I will add the 
null check.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to