rineholt    02/02/26 18:57:22

  Modified:    java/samples/attachments EchoAttachment.java
  Log:
  Fix to reflect that arrays types are now returned instead of ArrayList.
  
  Revision  Changes    Path
  1.8       +8 -10     xml-axis/java/samples/attachments/EchoAttachment.java
  
  Index: EchoAttachment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/attachments/EchoAttachment.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- EchoAttachment.java       8 Feb 2002 22:14:10 -0000       1.7
  +++ EchoAttachment.java       27 Feb 2002 02:57:22 -0000      1.8
  @@ -235,7 +235,7 @@
               throw new AxisFault("", (String) ret, null, null);
           }
   
  -        if (!(ret instanceof java.util.ArrayList)) {
  +        if (!(ret instanceof javax.activation.DataHandler[])) {
               //The wrong type of object that what was expected.
               System.out.println("Received unexpected type :" +
                   ret.getClass().getName());
  @@ -246,14 +246,12 @@
           //Still here, so far so good.
           //Now lets brute force compare the source attachment
           // to the one we received.
  -        java.util.ArrayList received = (java.util.ArrayList ) ret;
  +        javax.activation.DataHandler[] received = (javax.activation.DataHandler[] ) 
ret;
   
  -        int j = 0;
  -        java.util.ListIterator i =  received.listIterator();
  -
  -        for ( ; i.hasNext() && j < attachments.length; ) {
  -            DataHandler recDH = (DataHandler ) i.next();
  -            DataHandler orginalDH = attachments[j++];
  +        int i=0;
  +        for (  i=0; i< received.length && i < attachments.length; ++i ) {
  +            DataHandler recDH =  received[i];
  +            DataHandler orginalDH = attachments[i];
   
               if (!compareFiles( filename + java.io.File.separator + 
orginalDH.getName(), recDH.getName())) {
                   System.err.println("The attachment with the file name: \"" + 
orginalDH.getName() +
  @@ -265,12 +263,12 @@
               receivedFile.delete();
           }
   
  -        if (i.hasNext()) {
  +        if (i < received.length) {
               System.err.println("There are more file received than sent!!!!");
   
               rc = false;
           }
  -        if ( j < attachments.length ) {
  +        if ( i < attachments.length ) {
               System.err.println("Not all the files were received!");
               rc = false;
           }
  
  
  


Reply via email to