196 |
} |
} |
197 |
|
|
198 |
/** |
/** |
199 |
* Returns true if the objects are the same of have |
* Returns true if the objects are the same or have the same delegate set. All |
200 |
* the same delegate set. All objects in this implementation |
* objects in this implementation have a separate delegate. |
|
* have a separate delegate. |
|
201 |
*/ |
*/ |
202 |
public boolean is_equivalent(org.omg.CORBA.Object target, |
public boolean is_equivalent(org.omg.CORBA.Object target, |
203 |
org.omg.CORBA.Object other |
org.omg.CORBA.Object other) |
|
) |
|
204 |
{ |
{ |
205 |
if (target == other) |
if (target == other) |
206 |
return true; |
return true; |
208 |
{ |
{ |
209 |
try |
try |
210 |
{ |
{ |
211 |
org.omg.CORBA.portable.Delegate a = |
org.omg.CORBA.portable.Delegate a = ((ObjectImpl) target)._get_delegate(); |
212 |
((ObjectImpl) target)._get_delegate(); |
org.omg.CORBA.portable.Delegate b = ((ObjectImpl) other)._get_delegate(); |
|
org.omg.CORBA.portable.Delegate b = |
|
|
((ObjectImpl) other)._get_delegate(); |
|
213 |
if (a == b) |
if (a == b) |
214 |
{ |
{ |
215 |
return true; |
return true; |
216 |
} |
} |
217 |
|
else |
218 |
|
{ |
219 |
|
// We compere the IOR's in this case. |
220 |
|
if (a instanceof IorProvider && b instanceof IorProvider) |
221 |
|
{ |
222 |
|
IOR ia = ((IorProvider) a).getIor(); |
223 |
|
IOR ib = ((IorProvider) b).getIor(); |
224 |
|
|
225 |
|
if (ia != null && ib != null) |
226 |
|
return (ia.equals(ib)); |
227 |
|
else |
228 |
|
return ia == ib; |
229 |
|
} |
230 |
|
} |
231 |
if (a != null && b != null) |
if (a != null && b != null) |
232 |
{ |
{ |
233 |
return a.equals(b); |
return a.equals(b); |