From 1c4658c86ccd077bb53e31b76d81176ad35cc04b Mon Sep 17 00:00:00 2001 From: David McKnight Date: Mon, 20 Apr 2009 13:23:19 +0000 Subject: [PATCH] [271243] [files] Switching service type brings up TWO file subsystems after restart --- .../internal/persistence/dom/RSEDOMImporter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java index 0be0754b914..bcab937526f 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/persistence/dom/RSEDOMImporter.java @@ -25,6 +25,7 @@ * David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization * David McKnight (IBM) - [245198] [dstore] ServerLauncherProperties not restored * David McKnight (IBM) - [267052] need to be able to create subsystems-after-the-fact + * David McKnight (IBM) - [271243] [files] Switching service type brings up TWO file subsystems after restart ********************************************************************************/ package org.eclipse.rse.internal.persistence.dom; @@ -246,9 +247,19 @@ public class RSEDOMImporter { // is there a corresponding subsystem for this configuration? for (int i = 0; i < sses.length && !found; i++){ ISubSystem ss = sses[i]; - if (ss.getSubSystemConfiguration() == config){ + ISubSystemConfiguration ssConfig = ss.getSubSystemConfiguration(); + if (ssConfig == config){ found = true; } + else { + // check if the subsystem config service type is of the same type + Class ssServiceType = ssConfig.getServiceType(); + Class serviceType = config.getServiceType(); + if (ssServiceType != null && serviceType != null && ssServiceType.equals(serviceType)){ + found = true; + } + + } } // if not, create the subsystem after the fact