diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java index 4abf18a8345..65b78d48433 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/model/ISystemRegistry.java @@ -29,6 +29,7 @@ * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI * David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement * David Dykstal (IBM) - [235800] Document naming restriction for profiles and filter pools + * David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization ********************************************************************************/ package org.eclipse.rse.core.model; @@ -571,6 +572,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie /** * Creates subsystems for a given host and subsystem configurations. + * If a subsystem cannot be created then null is returned in its corresponding place in the returned array. * @param host the host. * @param configurations the subsystem configurations. * @return the array of subsystems corresponding to the array of given configurations. diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java index d511c2db477..a1545a61817 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/model/SystemRegistry.java @@ -55,6 +55,7 @@ * David Dykstal (IBM) - [227750] do not fire events if there are no listeners * David McKnight (IBM) - [238673] Expansion icon (plus sign) disappears from Work With Libraries entry * David McKnight (IBM) - [240991] RSE startup creates display on worker thread before workbench. + * David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization ********************************************************************************/ package org.eclipse.rse.internal.core.model; @@ -1642,7 +1643,9 @@ public class SystemRegistry implements ISystemRegistry } for (int j = 0; j < subsystems.length; j++) { - fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, subsystems[j], null); + if (subsystems[j] != null) { + fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, subsystems[j], null); + } } host.commit(); 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 7089f7bae1f..77a30110fbb 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 @@ -22,6 +22,7 @@ * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated * David Dykstal (IBM) - [232126] retrieve persisted filter type attribute * David Dykstal (IBM) - [233876] filters lost after restart + * David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization ********************************************************************************/ package org.eclipse.rse.internal.persistence.dom; @@ -282,34 +283,36 @@ public class RSEDOMImporter { ISubSystem[] createdSystems = _registry.createSubSystems(host, new ISubSystemConfiguration[]{factory}); subSystem = createdSystems[0]; } - subSystem.setHidden(isHidden); - subSystem.setHost(host); - subSystem.setSubSystemConfiguration(factory); - subSystem.setName(factory.getName()); - subSystem.setConfigurationId(factory.getId()); + if (subSystem != null) { + subSystem.setHidden(isHidden); + subSystem.setHost(host); + subSystem.setSubSystemConfiguration(factory); + subSystem.setName(factory.getName()); + subSystem.setConfigurationId(factory.getId()); - if (factory.supportsFilters()) { - ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere(); - ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name); - subSystem.setFilterPoolReferenceManager(fprMgr); - ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile()); - fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); - } + if (factory.supportsFilters()) { + ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere(); + ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name); + subSystem.setFilterPoolReferenceManager(fprMgr); + ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile()); + fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); + } - // restore filter pool references - RSEDOMNode[] filterPoolReferenceChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE); - for (int i = 0; i < filterPoolReferenceChildren.length; i++) { - RSEDOMNode fprChild = filterPoolReferenceChildren[i]; - restoreFilterPoolReference(subSystem, fprChild); - } + // restore filter pool references + RSEDOMNode[] filterPoolReferenceChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE); + for (int i = 0; i < filterPoolReferenceChildren.length; i++) { + RSEDOMNode fprChild = filterPoolReferenceChildren[i]; + restoreFilterPoolReference(subSystem, fprChild); + } - // restore all property sets - RSEDOMNode[] psChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); - for (int p = 0; p < psChildren.length; p++) { - RSEDOMNode psChild = psChildren[p]; - restorePropertySet(subSystem, psChild); + // restore all property sets + RSEDOMNode[] psChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); + for (int p = 0; p < psChildren.length; p++) { + RSEDOMNode psChild = psChildren[p]; + restorePropertySet(subSystem, psChild); + } + subSystem.wasRestored(); } - subSystem.wasRestored(); } return subSystem; } diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index ee7c7305c00..e13fc88520a 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -35,6 +35,7 @@ * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI * Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding() + * David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -961,10 +962,10 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration /** * Creates a new subsystem instance that is associated with the given - * connection object. SystemRegistryImpl calls this when a new connection is + * connection object. SystemRegistry calls this when a new connection is * created, and appliesToSystemType returns true. *

- * This method doe sthe following: + * This method does the following: *