summaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/CORBA/Simple_delegate.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/CORBA/Simple_delegate.java')
-rw-r--r--libjava/classpath/gnu/CORBA/Simple_delegate.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/libjava/classpath/gnu/CORBA/Simple_delegate.java b/libjava/classpath/gnu/CORBA/Simple_delegate.java
index d0b2ad29e0b..5eabc7da8a0 100644
--- a/libjava/classpath/gnu/CORBA/Simple_delegate.java
+++ b/libjava/classpath/gnu/CORBA/Simple_delegate.java
@@ -195,13 +195,40 @@ public class Simple_delegate
}
/**
- * Only returns true if the objects are equal ('==').
+ * Returns true if the objects are the same of 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
)
{
- return target == other;
+ if (target == other)
+ return true;
+ if ((target instanceof ObjectImpl) && other instanceof ObjectImpl)
+ {
+ try
+ {
+ 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;
+ }
+ if (a != null && b != null)
+ {
+ return a.equals(b);
+ }
+ }
+ catch (Exception ex)
+ {
+ // Unable to get one of the delegates.
+ return false;
+ }
+ }
+ return false;
}
/**
@@ -246,4 +273,4 @@ public class Simple_delegate
{
throw new InternalError();
}
-}
+} \ No newline at end of file