You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/07/27 04:46:47 UTC

cvs commit: ws-axis/java/src/org/apache/axis/encoding/ser SourceDataHandlerDeserializer.java

dims        2005/07/26 19:46:47

  Modified:    java/src/org/apache/axis/utils JavaUtils.java
               java/src/org/apache/axis/encoding/ser
                        SourceDataHandlerDeserializer.java
  Log:
  Fix for  AXIS-2142 -  ClassCastException in JavaUtils.convert
  from  Archit Shah
  
  Revision  Changes    Path
  1.119     +3 -4      ws-axis/java/src/org/apache/axis/utils/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- JavaUtils.java	26 Apr 2005 21:06:36 -0000	1.118
  +++ JavaUtils.java	27 Jul 2005 02:46:47 -0000	1.119
  @@ -295,7 +295,7 @@
                           // attachment, but if the image would be null
                           // (is.available == 0) then ImageIO component isn't needed
                           // and we can return null.
  -                        InputStream is = (InputStream) handler.getContent();
  +                        InputStream is = handler.getInputStream();
                           if (is.available() == 0) {
                               return null;
                           }
  @@ -314,15 +314,14 @@
                           // For a reason unknown to me, the handler's
                           // content is a String.  Convert it to a
                           // StreamSource.
  -                        return new StreamSource(new StringReader(
  -                                (String) handler.getContent()));
  +                        return new StreamSource(handler.getInputStream());
                       }
                       else if (destClass == OctetStream.class || destClass == byte[].class) {
                           InputStream in = null;
                           if (arg instanceof InputStream) {
                               in = (InputStream) arg;
                           } else {
  -                            in = (InputStream)handler.getContent();
  +                            in = handler.getInputStream();
                           }
                           ByteArrayOutputStream baos = new ByteArrayOutputStream();
                           int byte1 = -1;
  
  
  
  1.5       +1 -2      ws-axis/java/src/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java
  
  Index: SourceDataHandlerDeserializer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/encoding/ser/SourceDataHandlerDeserializer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SourceDataHandlerDeserializer.java	25 Feb 2004 14:02:37 -0000	1.4
  +++ SourceDataHandlerDeserializer.java	27 Jul 2005 02:46:47 -0000	1.5
  @@ -45,8 +45,7 @@
           if (getValue() instanceof DataHandler) {
               try {
                   DataHandler dh = (DataHandler) getValue();
  -                StreamSource ss = new StreamSource(new StringReader(
  -                        (String) dh.getContent()));
  +                StreamSource ss = new StreamSource(dh.getInputStream());
                   setValue(ss);
               }
               catch (IOException ioe) {