1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 559514 - Cleanup codebase

Lambda conversion.

Change-Id: I308f0249f83ad5ea51b7ab9988ad6bc9004b8e71
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2020-01-24 21:57:24 +02:00
parent 6ce8bf9982
commit f0b41feeff
4 changed files with 29 additions and 45 deletions

View file

@ -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 @@ package org.eclipse.remote.internal.proxy.ui;
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 @@ public class ProxyUIConnectionService extends AbstractRemoteUIConnectionService
@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 {

View file

@ -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 @@ public class ProxyUserAuthenticator implements IUserAuthenticatorService {
}
}
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]];
}

View file

@ -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 @@ package org.eclipse.remote.serial.internal.ui;
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 @@ public class SerialPortConnectionsUI extends AbstractRemoteUIConnectionService {
@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) {

View file

@ -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 @@ package org.eclipse.remote.telnet.internal.ui;
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 @@ public class TelnetConnectionsUI extends AbstractRemoteUIConnectionService {
@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) {