Hi,
I have internal plugin for Eclipse for working by ssh with others computers (by openSSH).
Current plugin working on Eclipse 3.3.2, RSE 2.0.3 and working normally.
Now I should upgrade it till Eclipse 4.3.2 and RSE 3.0.7. And I faced a problem.
In 98% situation I cannot finish my task. I to debug it and compare results of debug (on each step) and I found problem.
Method org.eclipse.rse.internal.subsystems.shells.servicesubsystem.OutputRefreshJob.runInUIThread(IProgressMonitor)
public IStatus runInUIThread(IProgressMonitor monitor)
{
try
{
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
if (_outputs != null)
{
if ((_outputs.length > 0) && (_outputs[0] != null)) {
registry.fireEvent(
new SystemResourceChangeEvent(_outputs, ISystemResourceChangeEvents.EVENT_REFRESH, _command));
}
if (_cwdChanged)
{
registry.fireEvent(
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, _command.getCommandSubSystem()));
}
//Bug 197848: Artificial event for shell termination
if (_outputs.length == 0 && !_command.isActive()) {
ISubSystem subsys = _command.getCommandSubSystem();
//update action states in commands view
registry.fireEvent(
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, subsys));
//update "connected" overlay in SystemView
registry.fireEvent(
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_REFRESH, subsys));
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
_isComplete= true;
return Status.OK_STATUS;
}
What I found. In first input to method the variable contains the needed output. We go in first 'if'
if ((_outputs.length > 0) && (_outputs[0] != null)) {
registry.fireEvent(new SystemResourceChangeEvent(_outputs, ISystemResourceChangeEvents.EVENT_REFRESH, _command));
}
This event to call my method, which outputs all from to eclipse console. It's normal and all ok.
But what happened in second call this method
.
In eclipse 3.3.2 the variable '_outputs' not contain anything and I go in
if (_outputs.length == 0 && !_command.isActive()) {
ISubSystem subsys = _command.getCommandSubSystem();
//update action states in commands view
registry.fireEvent(
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, subsys));
//update "connected" overlay in SystemView
registry.fireEvent(
new SystemResourceChangeEvent(_command, ISystemResourceChangeEvents.EVENT_REFRESH, subsys));
}
and initiate "EVENT_COMMAND_SHELL_FINISHED"
But in E4.3.2 '_output' contain my previous output and cannot to initiate "EVENT_COMMAND_SHELL_FINISHED"
Maybe you can suggest anything?