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

(fmspec) clarify meaning of "pass by reference" and "pass by copy" in RMI spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • Fix Understood
    • sparc
    • solaris_8

      From an external user:

      ] To: "'###@###.###'" <###@###.###>,
      ] "'###@###.###'" <###@###.###>,
      ] "'###@###.###'" <###@###.###>
      ] Subject: Description of local method calls
      ]
      ] Admittedly, I am splitting hairs here, but I am bothered by the way the EJB
      ] 2.0 (section 5.3) and RMI specifications (section 2.3) contrast argument
      ] passing in remote and local method calls. They both imply that local method
      ] calls pass arguments "by reference", whereas I believe it is technically "by
      ] value". Now, I can't find a description of argument passing in the Java
      ] Language Specification, but every book I've read and even the Java Tutorial
      ] (http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html, see
      ] excerpt below ) describes argument passing in local calls as being "by
      ] value" - specifically, the value of the reference (or primitive) passed as
      ] an argument.
      ]
      ] I am assuming the "pass by value" and "pass by copy" are both similar and in
      ] contrast to "pass by reference". If that is the case, these specifications
      ] would seem to be incorrect in saying local calls are "pass by reference" and
      ] remote calls are "pass by value (or copy)". If that is not the case, please
      ] explain. I realize that there IS a difference in the way arguments are
      ] passed in remote calls. I just think Sun should find a way to describe it
      ] that doesn't contradict how it has described local calls in other
      ] documentation. Do you see my point?

      Yes, the RMI spec should be more clear that it is referring specifically to object passing, which is a subtly different and higher-level view from the mechanics of the language, in which arguments are indeed always passed by value in local method invocations. This conflicting use of terminology is confusing without such a clarification. (See Comments for more discussion.)

            Unassigned Unassigned
            peterjones Peter Jones (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: