From 953aeeb8ecb0a53284bdbd538f88e75003be90e6 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Thu, 30 Oct 2008 19:09:26 +0000 Subject: [PATCH] [218309] ConcurrentModificationException during workbench startup --- .../.settings/.api_filters | 17 ++ .../subsystems/ISubSystemConfiguration.java | 39 ++-- .../subsystems/SubSystemConfiguration.java | 184 +++++++++--------- 3 files changed, 133 insertions(+), 107 deletions(-) create mode 100644 rse/plugins/org.eclipse.rse.core/.settings/.api_filters diff --git a/rse/plugins/org.eclipse.rse.core/.settings/.api_filters b/rse/plugins/org.eclipse.rse.core/.settings/.api_filters new file mode 100644 index 00000000000..f7502b1ed7b --- /dev/null +++ b/rse/plugins/org.eclipse.rse.core/.settings/.api_filters @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java index 6c2b9dcb20e..01e1bdf8e70 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java @@ -21,10 +21,13 @@ * Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI * Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding() + * Martin Oberhuber (Wind River) - [218309] ConcurrentModificationException during workbench startup ********************************************************************************/ package org.eclipse.rse.core.subsystems; +import java.util.List; + import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilterPool; @@ -70,14 +73,14 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide /** * Test whether subsystems managed by this configuration support custom * encodings. - * + * * Encodings specify the way how binary data on the remote system is * translated into Java Unicode Strings. RSE provides some means for the * User to specify a particular encoding to use; typically, all subsystems * that do support custom encodings specified should use the same encoding * such that they can interoperate. Therefore, encodings are usually * obtained from {@link IHost#getDefaultEncoding(boolean)}. - * + * * It's possible, however, that a particular subsystem "knows" that its * resources are always encoded in a particular way, and there is no * possibility to ever change that. The Subsystem Configuration would return @@ -88,11 +91,11 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide * underlying system type such that existing subsystem configurations can be * re-used in an environment where the encoding to use is pre-defined by the * system type or host connection. - * + * * If no subsystem registered against a given host supports encodings, the * corresponding UI controls on the IHost level are disabled in order to * avoid confusion to the user. - * + * * @return true if the RSE mechanisms for specifying custom * encodings are observed and supported by the subsystems managed * by this configuration for the given host. @@ -696,18 +699,30 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide public void saveSubSystem(ISubSystem subsys) throws Exception; /** - * Private. Do not call or use.
- * @generated This field/method will be replaced during code generation - * @return The list of SubSystemList references + * Return the internal list of subsystems instantiated for this + * configuration. Internal use only, do not call or use. Use + * {@link #getSubSystems(boolean)} with a false argument + * instead. + * + * @noreference This method is not intended to be referenced by clients. + * @return The internal list of SubSystem instances for this configuration. + * Any operations on this list (such as iterating, adding or + * removing members) must always be synchronized against the list, + * in order to protect against concurrent modification. */ - java.util.List getSubSystemList(); + List getSubSystemList(); /** - * Private. Do not call or use.
- * @generated This field/method will be replaced during code generation - * @return The list of FilterPoolManagerList references + * Return the internal list of filter pool managers associated with this + * configuration. Internal use only, do not call or use. + * + * @noreference This method is not intended to be referenced by clients. + * @return The internal list of filter pool Managers associated with this + * configuration. Any operations on this list (such as iterating, + * adding or removing members) must always be synchronized against + * the list, in order to protect against concurrent modification. */ - java.util.List getFilterPoolManagerList(); + List getFilterPoolManagerList(); public ISystemFilterPool getDefaultFilterPool(ISystemProfile profile, String oldProfileName); 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 62ebf5f2c33..68a521d72e1 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 @@ -36,6 +36,7 @@ * 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 + * Martin Oberhuber (Wind River) - [218309] ConcurrentModificationException during workbench startup ********************************************************************************/ package org.eclipse.rse.core.subsystems; @@ -44,7 +45,6 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.List; -import java.util.Vector; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; @@ -89,12 +89,11 @@ import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemPreferencesManager; import org.eclipse.rse.ui.messages.SystemMessageDialog; - /** * Abstract base class for subsystem configuration extension points. * Child classes must implement the methods: * * Child classes can optionally override: * *

- * A subsystem configuration will maintain in memory a list of all subsystem objects it has. This - * list should be initialize from disk at restore time, and maintained as the subsystems are - * created and deleted throughout the session. At save time, each subsystem in the list - * is asked to save itself. The getSubSystems method should return this list. + * A subsystem configuration will maintain in memory a list of all subsystem + * objects it has. This list should be initialized from disk at restore time, + * and maintained as the subsystems are created and deleted throughout the + * session. At save time, each subsystem in the list is asked to save itself. + * The getSubSystems method should return this list. *

- * To help with maintaining this list, this base class contains a Vector instance variable - * named subsystems. It is returned by the getSubSystems method in this base class. For this - * to be accurate you though, you should: + * To help with maintaining this list, this base class contains a List instance + * variable named subsystems. It is returned by the getSubSystems method in this + * base class. For this to be accurate you though, you should: *