Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-07-19 08:52:49 -0400
committerAlexander Kurtakov2018-07-19 08:52:49 -0400
commit233a9f42db3dcb0a0eaebbe55a3c2574802b9805 (patch)
tree0787422f4289580540142302596cd67234e7e0d0 /org.eclipse.debug.core
parent8c924456a516ce49087a542b155ee70c8d76ae38 (diff)
downloadeclipse.platform.debug-233a9f42db3dcb0a0eaebbe55a3c2574802b9805.tar.gz
eclipse.platform.debug-233a9f42db3dcb0a0eaebbe55a3c2574802b9805.tar.xz
eclipse.platform.debug-233a9f42db3dcb0a0eaebbe55a3c2574802b9805.zip
Bug 521038 - [refactoring] Replace anonymous Runnable classes by lambda
expression Changed some formatters to Eclipse so there is some formatting happening as the debug one is not clear where to get from and it's unrealistic to expect random contributors to do it. Change-Id: I731410854f9a4ac0c9fc18bcf3ad3dcf7d941c9a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java21
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java9
3 files changed, 12 insertions, 25 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
index 65c9d61dc..13396a8e8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java
@@ -94,12 +94,7 @@ public class InputStreamMonitor {
*/
public void startMonitoring() {
if (fThread == null) {
- fThread= new Thread(new Runnable() {
- @Override
- public void run() {
- write();
- }
- }, DebugCoreMessages.InputStreamMonitor_label);
+ fThread = new Thread((Runnable) () -> write(), DebugCoreMessages.InputStreamMonitor_label);
fThread.setDaemon(true);
fThread.start();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
index 4e4ae7064..29fdc0e5e 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
@@ -65,18 +65,15 @@ public class NullStreamsProxy implements IStreamsProxy2 {
}
private void startReaderThread() {
- Thread thread = new Thread(new Runnable() {
- @Override
- public void run() {
- byte[] bytes = new byte[1024];
- try {
- while(fStream.read(bytes) >= 0) {
- //do nothing
- }
- } catch (IOException e) {
- }
- }
- }, DebugCoreMessages.NullStreamsProxy_0);
+ Thread thread = new Thread((Runnable) () -> {
+ byte[] bytes = new byte[1024];
+ try {
+ while (fStream.read(bytes) >= 0) {
+ // do nothing
+ }
+ } catch (IOException e) {
+ }
+ }, DebugCoreMessages.NullStreamsProxy_0);
thread.setDaemon(true);
thread.start();
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
index e344e229b..4b9e432b1 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation 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
@@ -206,12 +206,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
*/
protected void startMonitoring() {
if (fThread == null) {
- fThread= new Thread(new Runnable() {
- @Override
- public void run() {
- read();
- }
- }, DebugCoreMessages.OutputStreamMonitor_label);
+ fThread = new Thread((Runnable) () -> read(), DebugCoreMessages.OutputStreamMonitor_label);
fThread.setDaemon(true);
fThread.setPriority(Thread.MIN_PRIORITY);
fThread.start();

Back to the top