/[classpath]/classpath/gnu/CORBA/SimpleDelegate.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/SimpleDelegate.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by gnu_andrew, Wed Nov 2 00:43:23 2005 UTC revision 1.1.2.2 by gnu_andrew, Sun Nov 27 21:00:36 2005 UTC
# Line 196  public class SimpleDelegate Line 196  public class SimpleDelegate
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;
# Line 210  public class SimpleDelegate Line 208  public class SimpleDelegate
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);

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26