diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java index d9cf24a051c..9e3a4e97bc8 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/BuildRunnerHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 Andrew Gvozdev and others. + * Copyright (c) 2012, 2013 Andrew Gvozdev 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 @@ -287,6 +287,8 @@ public class BuildRunnerHelper implements Closeable { if (!isCancelled && project != null) { project.setSessionProperty(progressPropertyName, new Integer(streamProgressMonitor.getWorkDone())); } + } catch (Exception e) { + CCorePlugin.log(e); } finally { monitor.done(); } diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java index 2cf4bcaea12..725b8c4c1a3 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/ProcessClosure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2013 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 @@ -17,6 +17,8 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; +import org.eclipse.core.runtime.Assert; + /** * Bundled state of a launched process including the threads linking the process * in/output to console documents. @@ -33,11 +35,11 @@ public class ProcessClosure { private OutputStream fOutputStream; private boolean fFinished = false; private String lineSeparator; - /* - * outputStream can be null - */ + public ReaderThread(ThreadGroup group, String name, InputStream in, OutputStream out) { super(group, name); + Assert.isNotNull(in); + Assert.isNotNull(out); fOutputStream = out; fInputStream = in; setDaemon(true); @@ -58,7 +60,6 @@ public class ProcessClosure { // ignore } finally { try { - // writer.flush(); fOutputStream.flush(); } catch (IOException e) { // ignore