Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4032460

rmi returns wrong stub

XMLWordPrintable

    • 1.1.1
    • sparc
    • solaris_2.5
    • Not verified

       I have a remote object which implements its own version of equals
      and hashcode. The hashcode value is the same for all instances of the
      class. The equals will compare equal if the state of the two objects
      are equal. With RMI, I can get back the stub to the wrong object in the
      following scenario:
       
      - - Client calls factory(other object I use to create objects) method on
      server to create object which I will call "A".
      - - Client calls factory method on server to create object "B".
      - - Client then calls factory to get object "A". What is actually
      returned is the stub to object "B".
       
      Since I have access to the RMI source, I looked to see that the equals
      method of WeakRef is called when the objects are stored into the
      hashtable. The equals method of WeakRef will call the equals on the
      actual objects? It seems like it would be more appropriate(and faster)
      for the equals of WeakRef to compare the references for equal rather
      than invoke the equals method.

            awollratsunw Ann Wollrath (Inactive)
            awollratsunw Ann Wollrath (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: