You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mk...@apache.org on 2019/12/09 23:51:02 UTC

[netbeans] branch master updated: [NETBEANS-3489] Fixed compiler warnings concerning rawtypes Callable and converted the calls into lambdas

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

mklaehn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 660d3c3  [NETBEANS-3489] Fixed compiler warnings concerning rawtypes Callable and converted the calls into lambdas
660d3c3 is described below

commit 660d3c3c48b8707bb7b0b4f6a274da01a7080984
Author: Martin Klähn <mk...@apache.org>
AuthorDate: Sat Nov 30 21:21:21 2019 +0100

    [NETBEANS-3489] Fixed compiler warnings concerning rawtypes Callable and converted the calls into lambdas
---
 .../core/network/utils/LocalAddressUtils.java      | 31 +++++++---------------
 1 file changed, 9 insertions(+), 22 deletions(-)

diff --git a/platform/core.network/src/org/netbeans/core/network/utils/LocalAddressUtils.java b/platform/core.network/src/org/netbeans/core/network/utils/LocalAddressUtils.java
index 660c6b6..68aa14f 100644
--- a/platform/core.network/src/org/netbeans/core/network/utils/LocalAddressUtils.java
+++ b/platform/core.network/src/org/netbeans/core/network/utils/LocalAddressUtils.java
@@ -100,34 +100,21 @@ public class LocalAddressUtils {
     private static Future<InetAddress[]> fut2;
     private static Future<List<InetAddress>> fut3;
 
-    private static final Callable<InetAddress> C1 = new Callable<InetAddress>(){
-        @Override
-        public InetAddress call() throws UnknownHostException  {
-            return InetAddress.getLocalHost();
-        }
-    };
-    private static final Callable<InetAddress[]> C2 = new Callable<InetAddress[]>(){
-        @Override
-        public InetAddress[] call() throws UnknownHostException  {
-            try {
-                String hostname = HostnameUtils.getNetworkHostname();
-                return InetAddress.getAllByName(hostname);
-            } catch (NativeException ex) {
-                throw new UnknownHostException(ex.getMessage() + ", error code : " + ex.getErrorCode());
-            }
-        }
-    };
-    private static final Callable<List<InetAddress>> C3 = new Callable<List<InetAddress>>(){
-        @Override
-        public List<InetAddress> call() {
-            return getLocalNetworkInterfaceAddr();
+    private static final Callable<InetAddress> C1 = () -> InetAddress.getLocalHost();
+    private static final Callable<InetAddress[]> C2 = () -> {
+        try {
+            String hostname = HostnameUtils.getNetworkHostname();
+            return InetAddress.getAllByName(hostname);
+        } catch (NativeException ex) {
+            throw new UnknownHostException(ex.getMessage() + ", error code : " + ex.getErrorCode());
         }
     };
+    private static final Callable<List<InetAddress>> C3 = () -> getLocalNetworkInterfaceAddr();
+
     static {
         refreshNetworkInfo(false);
     }
     
-    
     private LocalAddressUtils() {
     }
     


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists