Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2019-03-25 18:18:20 -0400
committerKarsten Thoms2019-04-16 08:15:35 -0400
commite5b4f42c768864837d6f15b5b2db8861d35f7829 (patch)
tree1356104ad5ccf2f55f1f4cf0502d5aea55a18ef8 /org.eclipse.ui.console
parent11b49a9a13e40c02ddea053664cdad25021a6d71 (diff)
downloadeclipse.platform.debug-e5b4f42c768864837d6f15b5b2db8861d35f7829.tar.gz
eclipse.platform.debug-e5b4f42c768864837d6f15b5b2db8861d35f7829.tar.xz
eclipse.platform.debug-e5b4f42c768864837d6f15b5b2db8861d35f7829.zip
If IOConsoleInputStream methods are called in some particular sequences they throw unwanted exceptions. Change-Id: I42f8237ceda47634ce94e98fe4c5d8894cf8d86a Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java19
1 files changed, 3 insertions, 16 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
index 04bc9468f..4cade5ad9 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -54,11 +54,6 @@ public class IOConsoleInputStream extends InputStream {
private int size = 0;
/**
- * Flag to indicate that EOF has been sent already.
- */
- private boolean eofSent = false;
-
- /**
* Flag to indicate that the stream has been closed.
*/
private boolean closed = false;
@@ -91,7 +86,7 @@ public class IOConsoleInputStream extends InputStream {
@Override
public synchronized int read(byte[] b, int off, int len) throws IOException {
waitForData();
- if (available() == -1) {
+ if (available() == 0) {
return -1;
}
@@ -118,7 +113,7 @@ public class IOConsoleInputStream extends InputStream {
@Override
public synchronized int read() throws IOException {
waitForData();
- if (available() == -1) {
+ if (available() == 0) {
return -1;
}
@@ -252,14 +247,6 @@ public class IOConsoleInputStream extends InputStream {
@Override
public int available() throws IOException {
- if (closed && eofSent) {
- throw new IOException("Input Stream Closed"); //$NON-NLS-1$
- } else if (size == 0) {
- if (!eofSent) {
- eofSent = true;
- return -1;
- }
- }
return size;
}

Back to the top