mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-19 06:05:56 +02:00
[194838] Xuan's patch to put common compare code in SystemRegistry. - ammendment for npe case
This commit is contained in:
parent
825fb49ddf
commit
85b84f72f8
1 changed files with 19 additions and 2 deletions
|
@ -1056,11 +1056,20 @@ public class SystemRegistry implements ISystemRegistry
|
||||||
ISystemDragDropAdapter adapter = null;
|
ISystemDragDropAdapter adapter = null;
|
||||||
|
|
||||||
adapter = (ISystemDragDropAdapter)((IAdaptable)firstObject).getAdapter(ISystemDragDropAdapter.class);
|
adapter = (ISystemDragDropAdapter)((IAdaptable)firstObject).getAdapter(ISystemDragDropAdapter.class);
|
||||||
|
String subSystemId = null;
|
||||||
|
|
||||||
if (adapter != null ) {
|
if (adapter != null ) {
|
||||||
// first need to check subsystems
|
// first need to check subsystems
|
||||||
ISubSystem subSystem = adapter.getSubSystem(firstObject);
|
ISubSystem subSystem = adapter.getSubSystem(firstObject);
|
||||||
String subSystemId = getAbsoluteNameForSubSystem(subSystem);
|
if (null != subSystem)
|
||||||
|
{
|
||||||
|
subSystemId = getAbsoluteNameForSubSystem(subSystem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subSystemId = ""; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
if (firstObjectFullName != null)
|
if (firstObjectFullName != null)
|
||||||
{
|
{
|
||||||
firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + firstObjectFullName; //$NON-NLS-1$
|
firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + firstObjectFullName; //$NON-NLS-1$
|
||||||
|
@ -1081,11 +1090,19 @@ public class SystemRegistry implements ISystemRegistry
|
||||||
ISystemDragDropAdapter adapter = null;
|
ISystemDragDropAdapter adapter = null;
|
||||||
|
|
||||||
adapter = (ISystemDragDropAdapter)((IAdaptable)secondObject).getAdapter(ISystemDragDropAdapter.class);
|
adapter = (ISystemDragDropAdapter)((IAdaptable)secondObject).getAdapter(ISystemDragDropAdapter.class);
|
||||||
|
String subSystemId = null;
|
||||||
|
|
||||||
if (adapter != null ) {
|
if (adapter != null ) {
|
||||||
// first need to check subsystems
|
// first need to check subsystems
|
||||||
ISubSystem subSystem = adapter.getSubSystem(secondObject);
|
ISubSystem subSystem = adapter.getSubSystem(secondObject);
|
||||||
String subSystemId = getAbsoluteNameForSubSystem(subSystem);
|
if (null != subSystem)
|
||||||
|
{
|
||||||
|
subSystemId = getAbsoluteNameForSubSystem(subSystem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
subSystemId = ""; //$NON-NLS-1$
|
||||||
|
}
|
||||||
if (secondObjectFullName != null)
|
if (secondObjectFullName != null)
|
||||||
{
|
{
|
||||||
secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + secondObjectFullName; //$NON-NLS-1$
|
secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + secondObjectFullName; //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue