Return object not reflecting changes

Discussions

XML & Web services: Return object not reflecting changes

  1. Return object not reflecting changes (2 messages)

    I am calling a method with a JDOM Document or String as one of its parameters, after doing some manipulation when I try recover this parameter in my caller class, I loose my changes. I am not returning this explicitly.
    eg:
    Method signature:
    public Boolean callXYZ(Document d1, String s1) {
    // manipulation of d1 and s1 here
    }

    Call:
    blnFlag = callXYZ(Document d, String s);

    Now both d and s do not reflect the changes made in callXYZ.

    Please let me know what the problem is?
  2. s won't, since strings are immutable. They operate on a pass by value basis (even though they are pass by ref.)

    Don't understand why d isn't updated though. IT should be pass by ref which should mean it's updated.

    Chz

    Tony
  3. Hi,

    If this is a method on an enterprise bean you are calling then you pass by value and the server will work with a copy of your Document object...

    Joost.