1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-16 13:35:22 +02:00

[236516] Bug in user code causes failure in RSE initialization

https://bugs.eclipse.org/bugs/show_bug.cgi?id=236516
This commit is contained in:
David Dykstal 2008-08-21 17:08:06 +00:00
parent a31c2048f4
commit 7cb4cceb59
4 changed files with 43 additions and 28 deletions

View file

@ -29,6 +29,7 @@
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI * 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) - [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) - [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; 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. * 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 host the host.
* @param configurations the subsystem configurations. * @param configurations the subsystem configurations.
* @return the array of subsystems corresponding to the array of given configurations. * @return the array of subsystems corresponding to the array of given configurations.

View file

@ -55,6 +55,7 @@
* David Dykstal (IBM) - [227750] do not fire events if there are no listeners * 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) - [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 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; package org.eclipse.rse.internal.core.model;
@ -1642,7 +1643,9 @@ public class SystemRegistry implements ISystemRegistry
} }
for (int j = 0; j < subsystems.length; j++) { 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(); host.commit();

View file

@ -22,6 +22,7 @@
* David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated * David Dykstal (IBM) - [225988] need API to mark persisted profiles as migrated
* David Dykstal (IBM) - [232126] retrieve persisted filter type attribute * David Dykstal (IBM) - [232126] retrieve persisted filter type attribute
* David Dykstal (IBM) - [233876] filters lost after restart * 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; package org.eclipse.rse.internal.persistence.dom;
@ -282,34 +283,36 @@ public class RSEDOMImporter {
ISubSystem[] createdSystems = _registry.createSubSystems(host, new ISubSystemConfiguration[]{factory}); ISubSystem[] createdSystems = _registry.createSubSystems(host, new ISubSystemConfiguration[]{factory});
subSystem = createdSystems[0]; subSystem = createdSystems[0];
} }
subSystem.setHidden(isHidden); if (subSystem != null) {
subSystem.setHost(host); subSystem.setHidden(isHidden);
subSystem.setSubSystemConfiguration(factory); subSystem.setHost(host);
subSystem.setName(factory.getName()); subSystem.setSubSystemConfiguration(factory);
subSystem.setConfigurationId(factory.getId()); subSystem.setName(factory.getName());
subSystem.setConfigurationId(factory.getId());
if (factory.supportsFilters()) { if (factory.supportsFilters()) {
ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere(); ISystemFilterStartHere startHere = _registry.getSystemFilterStartHere();
ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name); ISystemFilterPoolReferenceManager fprMgr = startHere.createSystemFilterPoolReferenceManager(subSystem, factory, name);
subSystem.setFilterPoolReferenceManager(fprMgr); subSystem.setFilterPoolReferenceManager(fprMgr);
ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile()); ISystemFilterPoolManager defaultFilterPoolManager = factory.getFilterPoolManager(host.getSystemProfile());
fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager); fprMgr.setDefaultSystemFilterPoolManager(defaultFilterPoolManager);
} }
// restore filter pool references // restore filter pool references
RSEDOMNode[] filterPoolReferenceChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE); RSEDOMNode[] filterPoolReferenceChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_FILTER_POOL_REFERENCE);
for (int i = 0; i < filterPoolReferenceChildren.length; i++) { for (int i = 0; i < filterPoolReferenceChildren.length; i++) {
RSEDOMNode fprChild = filterPoolReferenceChildren[i]; RSEDOMNode fprChild = filterPoolReferenceChildren[i];
restoreFilterPoolReference(subSystem, fprChild); restoreFilterPoolReference(subSystem, fprChild);
} }
// restore all property sets // restore all property sets
RSEDOMNode[] psChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET); RSEDOMNode[] psChildren = subSystemNode.getChildren(IRSEDOMConstants.TYPE_PROPERTY_SET);
for (int p = 0; p < psChildren.length; p++) { for (int p = 0; p < psChildren.length; p++) {
RSEDOMNode psChild = psChildren[p]; RSEDOMNode psChild = psChildren[p];
restorePropertySet(subSystem, psChild); restorePropertySet(subSystem, psChild);
}
subSystem.wasRestored();
} }
subSystem.wasRestored();
} }
return subSystem; return subSystem;
} }

View file

@ -35,6 +35,7 @@
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding() * 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; 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 * 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. * created, and appliesToSystemType returns true.
* <p> * <p>
* This method doe sthe following: * This method does the following:
* <ul> * <ul>
* <li>calls {@link #createSubSystemInternal(IHost)} to create the subsystem * <li>calls {@link #createSubSystemInternal(IHost)} to create the subsystem
* <li>does initialization of common attributes * <li>does initialization of common attributes
@ -986,6 +987,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
* @param configurators configurators that inject properties into this new * @param configurators configurators that inject properties into this new
* subsystem or null if there are none. Used to take * subsystem or null if there are none. Used to take
* ISystemNewConnectionWizardPage[] before RSE 3.0. * ISystemNewConnectionWizardPage[] before RSE 3.0.
* @return the created subsystem or null if none has been created.
* @since 3.0 * @since 3.0
*/ */
public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISubSystemConfigurator[] configurators) public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISubSystemConfigurator[] configurators)
@ -997,7 +999,12 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
reset(); reset();
subSystemsRestoredFlags.put(conn, Boolean.TRUE); // do not try to restore subsequently. Nothing to restore! subSystemsRestoredFlags.put(conn, Boolean.TRUE); // do not try to restore subsequently. Nothing to restore!
} }
ISubSystem subsys = createSubSystemInternal(conn); ISubSystem subsys = null;
try {
subsys = createSubSystemInternal(conn);
} catch (RuntimeException e) {
RSECorePlugin.getDefault().getLogger().logError("Error creating subsystem", e); //$NON-NLS-1$
}
if (subsys != null) if (subsys != null)
{ {
internalInitializeNewSubSystem(subsys, conn); internalInitializeNewSubSystem(subsys, conn);