Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 23106 invoked by uid 500); 27 Feb 2002 02:57:24 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 23090 invoked by uid 500); 27 Feb 2002 02:57:23 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 27 Feb 2002 02:57:23 -0000 Message-ID: <20020227025723.50513.qmail@icarus.apache.org> From: rineholt@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/samples/attachments EchoAttachment.java X-Spam-Rating: 63.251.56.142 1.6.2 0/1000/N 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; }