From 87f575eef51a76ced66bd90a4ca0940ded0bd840 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 14 May 2012 17:39:00 +0000 Subject: [PATCH] [379454] [shells] too many output refresh jobs created when populating shell output --- .../servicesubsystem/ServiceCommandShell.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ServiceCommandShell.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ServiceCommandShell.java index a3c18e7ca2f..7ca29b6690e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ServiceCommandShell.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ServiceCommandShell.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2012 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 @@ -13,6 +13,7 @@ * * Contributors: * Martin Oberhuber (Wind River) - [225510][api] Fix OutputRefreshJob API leakage + * David McKnight (IBM) - [379454] [shells] too many output refresh jobs created when populating shell output *******************************************************************************/ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; @@ -88,16 +89,7 @@ public class ServiceCommandShell extends RemoteCommandShell implements IServiceC outputs[i] = output; } } - // FIXME unify with notifyListeners() below? - if (_lastRefreshJob == null || _lastRefreshJob.isComplete()) - { - _lastRefreshJob = new OutputRefreshJob(this, outputs, false); - _lastRefreshJob.schedule(); - } - else - { - _lastRefreshJob.addOutputs(outputs); - } + notifyOutputChanged(outputs, false); } /** @@ -109,15 +101,14 @@ public class ServiceCommandShell extends RemoteCommandShell implements IServiceC * @since org.eclipse.rse.subsystems.shells.core 3.0 */ protected void notifyOutputChanged(IRemoteOutput[] outputs, boolean cwdChanged) { - // if (_lastRefreshJob == null || _lastRefreshJob.isComplete()) - { + if (_lastRefreshJob == null || _lastRefreshJob.isComplete()){ _lastRefreshJob = new OutputRefreshJob(this, outputs, cwdChanged); _lastRefreshJob.schedule(); } - /* - * else { _lastRefreshJob.addOutputs(outputs); - * _lastRefreshJob.schedule(); } - */ + else { + _lastRefreshJob.addOutputs(outputs); + _lastRefreshJob.schedule(); + } } public ICandidateCommand[] getCandidateCommands()