axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser JAFDataHandlerSerializer.java
Date Fri, 30 Aug 2002 17:17:59 GMT
butek       2002/08/30 10:17:59

  Modified:    java/src/org/apache/axis/encoding/ser
                        JAFDataHandlerSerializer.java
  Log:
  Fixed (sorta) http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11781.
  That bug turned out to be user error, but the user was getting a very
  unfriendly NullPointerException.  Now at least AXIS will tell the user:
  
  java.io.IOException: No support for attachments.
  
  Revision  Changes    Path
  1.18      +8 -0      xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java
  
  Index: JAFDataHandlerSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JAFDataHandlerSerializer.java	9 Jul 2002 11:28:25 -0000	1.17
  +++ JAFDataHandlerSerializer.java	30 Aug 2002 17:17:58 -0000	1.18
  @@ -111,6 +111,14 @@
           DataHandler dh= (DataHandler)value;
           //Add the attachment content to the message.
           Attachments attachments= context.getCurrentMessage().getAttachmentsImpl();
  +
  +        if (attachments == null) {
  +            // Attachments apparently aren't supported.
  +            // Instead of throwing NullPointerException like
  +            // we used to do, throw something meaningful.
  +            throw new IOException(JavaUtils.getMessage("noAttachments"));
  +        }
  +
           Part attachmentPart= attachments.createAttachmentPart(dh);
   
           AttributesImpl attrs = new AttributesImpl();
  
  
  

Mime
View raw message