owenb       2002/11/08 09:09:43

  Modified:    java/src/org/apache/wsif/base Tag: pre1_2_0-patches
                        WSIFDefaultMessage.java
  Log:
  Improvement to clone method. Check to see if a port being cloned is null and if so, 
set a null part value on the message clone
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.1   +12 -1     
xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultMessage.java
  
  Index: WSIFDefaultMessage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultMessage.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- WSIFDefaultMessage.java   24 Oct 2002 16:09:07 -0000      1.8
  +++ WSIFDefaultMessage.java   8 Nov 2002 17:09:43 -0000       1.8.2.1
  @@ -499,7 +499,18 @@
           while (it.hasNext()) {
               String pn = (String) it.next();
               Object po = parts.get(pn);
  -            if (po instanceof Cloneable) {
  +            if (po == null) {
  +                try {
  +                    dm.setObjectPart(pn, null);
  +                } catch (Exception e) {
  +                    Trc.exception(e);
  +                    throw new CloneNotSupportedException(
  +                        "Exception thrown whilst cloning part "
  +                            + pn
  +                            + ". Message is "
  +                        + e.getMessage());
  +                }
  +            } else if (po instanceof Cloneable) {
                   Class cls = po.getClass();
                   try {
                       Method clone = cls.getMethod("clone", null);
  
  
  


Reply via email to