mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-20 06:35:50 +02:00
[244230] NPE when using SystemRegistry.getSubsystem(String)
This commit is contained in:
parent
010cdc73c0
commit
4ec2655237
2 changed files with 10 additions and 12 deletions
|
@ -274,10 +274,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve a subsystem from it's absolute name
|
* 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
|
* @param absoluteSubSystemName the name of the subsystem
|
||||||
*
|
* @return the subsystem or null if the profile, connection, or subsystem configuration cannot be found.
|
||||||
* @return the subsystem
|
|
||||||
*/
|
*/
|
||||||
public ISubSystem getSubSystem(String absoluteSubSystemName);
|
public ISubSystem getSubSystem(String absoluteSubSystemName);
|
||||||
|
|
||||||
|
|
|
@ -785,16 +785,12 @@ public class SystemRegistry implements ISystemRegistry
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* (non-Javadoc)
|
||||||
* Resolve a subsystem from it's absolute name. The absolute name of a subsystem
|
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystem(java.lang.String)
|
||||||
* is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I>
|
|
||||||
*
|
|
||||||
* @param absoluteSubSystemName the name of the subsystem
|
|
||||||
*
|
|
||||||
* @return the subsystem
|
|
||||||
*/
|
*/
|
||||||
public ISubSystem getSubSystem(String absoluteSubSystemName)
|
public ISubSystem getSubSystem(String absoluteSubSystemName)
|
||||||
{
|
{
|
||||||
|
ISubSystem result = null;
|
||||||
// first extract subsystem id
|
// first extract subsystem id
|
||||||
int profileDelim = absoluteSubSystemName.indexOf("."); //$NON-NLS-1$
|
int profileDelim = absoluteSubSystemName.indexOf("."); //$NON-NLS-1$
|
||||||
int connectionDelim = absoluteSubSystemName.indexOf(":", profileDelim + 1); //$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());
|
String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length());
|
||||||
|
|
||||||
ISystemProfile profile = getSystemProfile(srcProfileName);
|
ISystemProfile profile = getSystemProfile(srcProfileName);
|
||||||
return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId);
|
if (profile != null) {
|
||||||
|
result = getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue