Bug 559514 - Cleanup codebase

Lambda conversion.

Change-Id: I308f0249f83ad5ea51b7ab9988ad6bc9004b8e71
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUIConnectionService.java b/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUIConnectionService.java
index 0001749..6d4e63f 100644
--- a/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUIConnectionService.java
+++ b/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUIConnectionService.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016 Oak Ridge National Laboratory and others.
+ * Copyright (c) 2016, 2020 Oak Ridge National Laboratory and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,7 +9,6 @@
 
 import java.lang.reflect.InvocationTargetException;
 
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.ErrorDialog;
@@ -61,17 +60,14 @@
 	@Override
 	public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) {
 		if (!connection.isOpen()) {
-			IRunnableWithProgress op = new IRunnableWithProgress() {
-				@Override
-				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-					try {
-						connection.open(monitor);
-					} catch (RemoteConnectionException e) {
-						throw new InvocationTargetException(e);
-					}
-					if (monitor.isCanceled()) {
-						throw new InterruptedException();
-					}
+			IRunnableWithProgress op = monitor -> {
+				try {
+					connection.open(monitor);
+				} catch (RemoteConnectionException e) {
+					throw new InvocationTargetException(e);
+				}
+				if (monitor.isCanceled()) {
+					throw new InterruptedException();
 				}
 			};
 			try {
diff --git a/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUserAuthenticator.java b/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUserAuthenticator.java
index 6146764..36e4315 100644
--- a/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUserAuthenticator.java
+++ b/bundles/org.eclipse.remote.proxy.ui/src/org/eclipse/remote/internal/proxy/ui/ProxyUserAuthenticator.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2016 Oak Ridge National Laboratory and others.
+ * Copyright (c) 2016, 2020 Oak Ridge National Laboratory and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -84,13 +84,10 @@
 			}
 		}
 
-		display.syncExec(new Runnable() {
-			@Override
-			public void run() {
-				final MessageDialog dialog = new MessageDialog(display.getActiveShell(), title, null /* title image */, message,
-						promptType, buttons, defaultResponseIndex);
-				retval[0] = dialog.open();
-			}
+		display.syncExec(() -> {
+			final MessageDialog dialog = new MessageDialog(display.getActiveShell(), title, null /* title image */, message,
+					promptType, buttons, defaultResponseIndex);
+			retval[0] = dialog.open();
 		});
 		return promptResponses[retval[0]];
 	}
diff --git a/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/SerialPortConnectionsUI.java b/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/SerialPortConnectionsUI.java
index c8abdd1..ef93878 100644
--- a/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/SerialPortConnectionsUI.java
+++ b/bundles/org.eclipse.remote.serial.ui/src/org/eclipse/remote/serial/internal/ui/SerialPortConnectionsUI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems, and others.
+ * Copyright (c) 2015, 2020 QNX Software Systems, and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,9 +12,7 @@
 
 import java.lang.reflect.InvocationTargetException;
 
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.remote.core.IRemoteConnection;
 import org.eclipse.remote.core.IRemoteConnectionType;
@@ -59,14 +57,11 @@
 	@Override
 	public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) {
 		try {
-			context.run(false, true, new IRunnableWithProgress() {
-				@Override
-				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-					try {
-						connection.open(monitor);
-					} catch (RemoteConnectionException e) {
-						Activator.log(e.getStatus());
-					}
+			context.run(false, true, monitor -> {
+				try {
+					connection.open(monitor);
+				} catch (RemoteConnectionException e) {
+					Activator.log(e.getStatus());
 				}
 			});
 		} catch (InvocationTargetException | InterruptedException e) {
diff --git a/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/TelnetConnectionsUI.java b/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/TelnetConnectionsUI.java
index 51b5ed7..c2fd1ce 100644
--- a/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/TelnetConnectionsUI.java
+++ b/bundles/org.eclipse.remote.telnet.ui/src/org/eclipse/remote/telnet/internal/ui/TelnetConnectionsUI.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems, and others.
+ * Copyright (c) 2015, 2020 QNX Software Systems, and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
 
 import java.lang.reflect.InvocationTargetException;
 
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableContext;
 import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -60,17 +59,14 @@
 	@Override
 	public void openConnectionWithProgress(Shell shell, IRunnableContext context, final IRemoteConnection connection) {
 		try {
-			IRunnableWithProgress op = new IRunnableWithProgress() {
-				@Override
-				public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-					try {
-						connection.open(monitor);
-					} catch (RemoteConnectionException e) {
-						throw new InvocationTargetException(e);
-					}
-					if (monitor.isCanceled()) {
-						throw new InterruptedException();
-					}
+			IRunnableWithProgress op = monitor -> {
+				try {
+					connection.open(monitor);
+				} catch (RemoteConnectionException e) {
+					throw new InvocationTargetException(e);
+				}
+				if (monitor.isCanceled()) {
+					throw new InterruptedException();
 				}
 			};
 			if (context != null) {