mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +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:
parent
a31c2048f4
commit
7cb4cceb59
4 changed files with 43 additions and 28 deletions
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
* <p>
|
||||
* This method doe sthe following:
|
||||
* This method does the following:
|
||||
* <ul>
|
||||
* <li>calls {@link #createSubSystemInternal(IHost)} to create the subsystem
|
||||
* <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
|
||||
* subsystem or null if there are none. Used to take
|
||||
* ISystemNewConnectionWizardPage[] before RSE 3.0.
|
||||
* @return the created subsystem or null if none has been created.
|
||||
* @since 3.0
|
||||
*/
|
||||
public ISubSystem createSubSystem(IHost conn, boolean creatingConnection, ISubSystemConfigurator[] configurators)
|
||||
|
@ -997,7 +999,12 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
reset();
|
||||
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)
|
||||
{
|
||||
internalInitializeNewSubSystem(subsys, conn);
|
||||
|
|
Loading…
Add table
Reference in a new issue