Return object not reflecting changes


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.
    Method signature:
    public Boolean callXYZ(Document d1, String s1) {
    // manipulation of d1 and s1 here

    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.


  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...