Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.progress.UIJob;

/**
* A console for a system process with standard I/O streams.
Expand All @@ -115,7 +114,7 @@
*/
@SuppressWarnings("deprecation")
public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSetListener, IPropertyChangeListener {
private IProcess fProcess = null;
private IProcess fProcess;

private final List<StreamListener> fStreamListeners = new ArrayList<>();

Expand All @@ -136,9 +135,9 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
private FileOutputStream fFileOutputStream;

private boolean fAllocateConsole = true;
private String fStdInFile = null;
private String fStdInFile;

private volatile boolean fStreamsClosed = false;
private volatile boolean fStreamsClosed;

/**
* Create process console with default encoding.
Expand Down Expand Up @@ -649,18 +648,12 @@ private synchronized void resetName(boolean changed) {
final String newName = computeName();
String name = getName();
if (!name.equals(newName)) {
UIJob job = new UIJob("Update console title") { //$NON-NLS-1$
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ProcessConsole.this.setName(newName);
if (changed) {
warnOfContentChange();
}
return Status.OK_STATUS;
DebugUIPlugin.getStandardDisplay().execute(() -> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing from UIJob to execute had the unintended side effect of possible SWT disposed Exceptions - please see #2554

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonahgraham : thanks, I'm aware about this issue, I will check this later.

setName(newName);
if (changed) {
warnOfContentChange();
}
};
job.setSystem(true);
job.schedule();
});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void updateElements() {
final Display display = DebugUIPlugin.getStandardDisplay();
BusyIndicator.showWhile(display, () -> {
final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables();
display.asyncExec(() -> setListElements(elements));
display.asyncExec(() -> setListElements((Object[]) elements));
});
}

Expand All @@ -180,7 +180,7 @@ private void updateDescription() {
}

@Override
protected void setListElements(Object[] elements) {
protected void setListElements(Object... elements) {
ArrayList<Object> filtered = new ArrayList<>();
filtered.addAll(Arrays.asList(elements));
if(!fFilters.isEmpty() && !fShowAllSelected) {
Expand Down Expand Up @@ -303,7 +303,7 @@ protected void editVariables() {
if (showVariablesPage()) {
final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager()
.getVariables();
display.asyncExec(() -> setListElements(elements));
display.asyncExec(() -> setListElements((Object[]) elements));
}
});
}
Expand Down
Loading