axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/message MimeHeaders.java
Date Sun, 23 Nov 2003 03:08:06 GMT
dims        2003/11/22 19:08:06

  Modified:    java/src/org/apache/axis/message MimeHeaders.java
  Log:
  Hopefully final Fix for Bug 22977 - org.apache.axis.Message cannot be serialized
  
  Revision  Changes    Path
  1.2       +15 -4     ws-axis/java/src/org/apache/axis/message/MimeHeaders.java
  
  Index: MimeHeaders.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/MimeHeaders.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MimeHeaders.java	26 Sep 2003 18:16:21 -0000	1.1
  +++ MimeHeaders.java	23 Nov 2003 03:08:06 -0000	1.2
  @@ -72,7 +72,8 @@
       public MimeHeaders(javax.xml.soap.MimeHeaders h) {
           Iterator iterator = h.getAllHeaders();
           while (iterator.hasNext()) {
  -            headers.add(iterator.next());
  +            MimeHeader hdr = (MimeHeader) iterator.next();
  +            addHeader(hdr.getName(), hdr.getValue());
           }
       }
   
  @@ -81,17 +82,27 @@
           for (int i = 0; i < size; i++) {
               Object key = in.readObject();
               Object value = in.readObject();
  -            headers.add(new MimeHeader((String) key, (String)value));
  +            addHeader((String)key, (String)value);
           }
       }
   
       public void writeExternal(ObjectOutput out) throws IOException {
  -        out.writeInt(headers.size());
  -        Iterator iterator = headers.iterator();
  +        out.writeInt(getHeaderSize());
  +        Iterator iterator = getAllHeaders();
           while (iterator.hasNext()) {
               MimeHeader hdr = (MimeHeader) iterator.next();
               out.writeObject(hdr.getName());
               out.writeObject(hdr.getValue());
           }
  +    }
  +
  +    private int getHeaderSize() {
  +        int size = 0;
  +        Iterator iterator = getAllHeaders();
  +        while (iterator.hasNext()) {
  +            iterator.next();
  +            size++;
  +        }
  +        return size;
       }
   }
  
  
  

Mime
View raw message