diff options
author | Thomas Wolf | 2021-10-30 12:50:57 +0000 |
---|---|---|
committer | Sarika Sinha | 2021-11-02 06:29:58 +0000 |
commit | 758aa89360e4c9eb222af7914c67d764107c408c (patch) | |
tree | 62b8c65196538b9bdb55382bd9b5b34a2154d856 | |
parent | 39150a4dc8af145c12f350efbcca07eb6a391d51 (diff) | |
download | eclipse.jdt.debug-758aa89360e4c9eb222af7914c67d764107c408c.tar.gz eclipse.jdt.debug-758aa89360e4c9eb222af7914c67d764107c408c.tar.xz eclipse.jdt.debug-758aa89360e4c9eb222af7914c67d764107c408c.zip |
Bug 576979 - Use LF as line endingsI20211103-0020I20211102-1800I20211102-1020
AbstractReader used CR (not CRLF!) as line endings. Replace all CRs
by LFs.
Change-Id: I32c9ceca7886dbaa656c8aa222026fd52944ad9c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.debug/+/187192
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Sarika Sinha <sarika.sinha@in.ibm.com>
-rw-r--r-- | org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractReader.java | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractReader.java b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractReader.java index 67bdaae36..c1620bc59 100644 --- a/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractReader.java +++ b/org.eclipse.jdt.debug.jdi.tests/tests/org/eclipse/debug/jdi/tests/AbstractReader.java @@ -10,4 +10,50 @@ * * Contributors: * IBM Corporation - initial API and implementation - *******************************************************************************/
package org.eclipse.debug.jdi.tests;
/**
* An abstract reader that continuously reads.
*/
abstract public class AbstractReader {
protected String fName;
protected Thread fReaderThread;
protected boolean fIsStopping = false;
/**
* Constructor
* @param name
*/
public AbstractReader(String name) {
fName = name;
}
/**
* Continuously reads. Note that if the read involves waiting
* it can be interrupted and a InterruptedException will be thrown.
*/
abstract protected void readerLoop();
/**
* Start the thread that reads events.
*
*/
public void start() {
fReaderThread = new Thread(new Runnable() {
@Override
public void run() {
readerLoop();
}
}, fName);
fReaderThread.setDaemon(true);
fReaderThread.start();
}
/**
* Tells the reader loop that it should stop.
*/
public void stop() {
fIsStopping = true;
if (fReaderThread != null) {
fReaderThread.interrupt();
}
}
}
\ No newline at end of file + *******************************************************************************/ +package org.eclipse.debug.jdi.tests; + +/** + * An abstract reader that continuously reads. + */ +abstract public class AbstractReader { + protected String fName; + protected Thread fReaderThread; + protected boolean fIsStopping = false; + + /** + * Constructor + * @param name + */ + public AbstractReader(String name) { + fName = name; + } + /** + * Continuously reads. Note that if the read involves waiting + * it can be interrupted and a InterruptedException will be thrown. + */ + abstract protected void readerLoop(); + /** + * Start the thread that reads events. + * + */ + public void start() { + fReaderThread = new Thread(new Runnable() { + @Override + public void run() { + readerLoop(); + } + }, fName); + fReaderThread.setDaemon(true); + fReaderThread.start(); + } + /** + * Tells the reader loop that it should stop. + */ + public void stop() { + fIsStopping = true; + if (fReaderThread != null) { + fReaderThread.interrupt(); + } + } +}
\ No newline at end of file |