diff options
| author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2005-11-06 13:26:23 +0000 |
|---|---|---|
| committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2005-11-06 13:26:23 +0000 |
| commit | 4c12c8d341aadd698a2c2dbd7716b45f271f0ebe (patch) | |
| tree | a6d3b80289520c09d1380d6daa83fdebafb3e709 /gnu/CORBA/SimpleDelegate.java | |
| parent | 88f7e4891055e88e79871345f4bc7f6d4f37480e (diff) | |
| download | classpath-4c12c8d341aadd698a2c2dbd7716b45f271f0ebe.tar.gz | |
2005-11-06 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/CORBA/IOR.java (equals, hashCode): New metods.
* gnu/CORBA/SimpleDelegate.java (is_equivalent): Compare IORs when applicable.
Diffstat (limited to 'gnu/CORBA/SimpleDelegate.java')
| -rw-r--r-- | gnu/CORBA/SimpleDelegate.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/gnu/CORBA/SimpleDelegate.java b/gnu/CORBA/SimpleDelegate.java index 3b5e1d81c..c6e20e173 100644 --- a/gnu/CORBA/SimpleDelegate.java +++ b/gnu/CORBA/SimpleDelegate.java @@ -196,13 +196,11 @@ public class SimpleDelegate } /** - * Returns true if the objects are the same of have - * the same delegate set. All objects in this implementation - * have a separate delegate. + * Returns true if the objects are the same or have the same delegate set. All + * objects in this implementation have a separate delegate. */ public boolean is_equivalent(org.omg.CORBA.Object target, - org.omg.CORBA.Object other - ) + org.omg.CORBA.Object other) { if (target == other) return true; @@ -210,14 +208,26 @@ public class SimpleDelegate { try { - org.omg.CORBA.portable.Delegate a = - ((ObjectImpl) target)._get_delegate(); - org.omg.CORBA.portable.Delegate b = - ((ObjectImpl) other)._get_delegate(); + org.omg.CORBA.portable.Delegate a = ((ObjectImpl) target)._get_delegate(); + org.omg.CORBA.portable.Delegate b = ((ObjectImpl) other)._get_delegate(); if (a == b) { return true; } + else + { + // We compere the IOR's in this case. + if (a instanceof IorProvider && b instanceof IorProvider) + { + IOR ia = ((IorProvider) a).getIor(); + IOR ib = ((IorProvider) b).getIor(); + + if (ia != null && ib != null) + return (ia.equals(ib)); + else + return ia == ib; + } + } if (a != null && b != null) { return a.equals(b); |
