Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlain Magloire2002-12-13 16:33:21 +0000
committerAlain Magloire2002-12-13 16:33:21 +0000
commit0c38e196c5a3730b923cd23bca38dd6b8b700608 (patch)
treeafec55e7dec4b7077f662229a1d4e54a263a078f /core
parente075c3c614c3ec73f5123cc4aefde51900777acc (diff)
downloadorg.eclipse.cdt-0c38e196c5a3730b923cd23bca38dd6b8b700608.tar.gz
org.eclipse.cdt-0c38e196c5a3730b923cd23bca38dd6b8b700608.tar.xz
org.eclipse.cdt-0c38e196c5a3730b923cd23bca38dd6b8b700608.zip
Remove workaround for J9
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java45
1 files changed, 8 insertions, 37 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
index 1d89411ea8b..7971cc39329 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
@@ -134,40 +134,8 @@ public class CommandLauncher {
PipedOutputStream outputPipe = new PipedOutputStream();
PipedInputStream errInPipe, inputPipe;
try {
- errInPipe = new PipedInputStream(errOutPipe) {
- /**
- * FIXME: To remove when j9 is fix.
- * The overloading here corrects a bug in J9
- * When the ring buffer when full it returns 0 .
- */
- public synchronized int available() throws IOException {
- if(in < 0 || buffer == null)
- return 0;
- else if(in == out)
- return buffer.length;
- else if (in > out)
- return in - out;
- else
- return in + buffer.length - out;
- }
- };
- inputPipe = new PipedInputStream(outputPipe) {
- /**
- * FIXME: To remove when j9 is fix.
- * The overloading here corrects a bug in J9
- * When the ring buffer when full returns 0.
- */
- public synchronized int available() throws IOException {
- if(in < 0 || buffer == null)
- return 0;
- else if(in == out)
- return buffer.length;
- else if (in > out)
- return in - out;
- else
- return in + buffer.length - out;
- }
- };
+ errInPipe = new PipedInputStream(errOutPipe);
+ inputPipe = new PipedInputStream(outputPipe);
} catch( IOException e ) {
setErrorMessage("Command canceled");
return COMMAND_CANCELED;
@@ -178,6 +146,7 @@ public class CommandLauncher {
byte buffer[] = new byte[1024];
int nbytes;
while (!monitor.isCanceled() && closure.isAlive()) {
+ nbytes = 0;
try {
if ( errInPipe.available() > 0 ) {
nbytes = errInPipe.read(buffer);
@@ -192,9 +161,11 @@ public class CommandLauncher {
} catch( IOException e) {
}
monitor.worked(0);
- try {
- Thread.sleep(DELAY);
- } catch (InterruptedException ie) {
+ if (nbytes == 0) {
+ try {
+ Thread.sleep(DELAY);
+ } catch (InterruptedException ie) {
+ }
}
}

Back to the top