diff options
author | David Dykstal | 2008-08-14 19:21:19 +0000 |
---|---|---|
committer | David Dykstal | 2008-08-14 19:21:19 +0000 |
commit | 4ec26552372d6b40f21c50502213053bf84268d7 (patch) | |
tree | 9980fd7f29e7f923c9dd5b82ab6b6c0d1d45fc36 | |
parent | 010cdc73c06856b044741f3fb9d4aa2218b22bc0 (diff) | |
download | org.eclipse.tm-4ec26552372d6b40f21c50502213053bf84268d7.tar.gz org.eclipse.tm-4ec26552372d6b40f21c50502213053bf84268d7.tar.xz org.eclipse.tm-4ec26552372d6b40f21c50502213053bf84268d7.zip |
[244230] NPE when using SystemRegistry.getSubsystem(String)
2 files changed, 10 insertions, 12 deletions
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 91e5479f1..4abf18a83 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 @@ -274,10 +274,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie /** * Resolve a subsystem from it's absolute name - * + * The absolute name of a subsystem + * is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I> * @param absoluteSubSystemName the name of the subsystem - * - * @return the subsystem + * @return the subsystem or null if the profile, connection, or subsystem configuration cannot be found. */ public ISubSystem getSubSystem(String absoluteSubSystemName); 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 f5dd1b21b..d511c2db4 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 @@ -785,16 +785,12 @@ public class SystemRegistry implements ISystemRegistry return result; } - /** - * Resolve a subsystem from it's absolute name. The absolute name of a subsystem - * is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I> - * - * @param absoluteSubSystemName the name of the subsystem - * - * @return the subsystem + /* (non-Javadoc) + * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystem(java.lang.String) */ public ISubSystem getSubSystem(String absoluteSubSystemName) { + ISubSystem result = null; // first extract subsystem id int profileDelim = absoluteSubSystemName.indexOf("."); //$NON-NLS-1$ int connectionDelim = absoluteSubSystemName.indexOf(":", profileDelim + 1); //$NON-NLS-1$ @@ -806,10 +802,12 @@ public class SystemRegistry implements ISystemRegistry String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length()); ISystemProfile profile = getSystemProfile(srcProfileName); - return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId); + if (profile != null) { + result = getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId); + } } - return null; + return result; } /** |