Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 65781 invoked from network); 18 Jun 2007 03:32:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 03:32:37 -0000 Received: (qmail 7058 invoked by uid 500); 18 Jun 2007 03:32:40 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 6998 invoked by uid 500); 18 Jun 2007 03:32:40 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 6987 invoked by uid 99); 18 Jun 2007 03:32:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jun 2007 20:32:40 -0700 Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 17 Jun 2007 20:32:35 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4DE961A981C; Sun, 17 Jun 2007 20:31:43 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r548190 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java Date: Mon, 18 Jun 2007 03:31:43 -0000 To: cxf-commits@incubator.apache.org From: dandiep@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070618033143.4DE961A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dandiep Date: Sun Jun 17 20:31:42 2007 New Revision: 548190 URL: http://svn.apache.org/viewvc?view=rev&rev=548190 Log: Make SwaInInterceptor a bit more robust. Any attachment that has an index greater than the list size can simply be appended to the end of the list. This prevents conflicts with the HolderInInterceptor. Attachments which have an index less than the list size can be inserted. Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java?view=diff&rev=548190&r1=548189&r2=548190 ============================================================================== --- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java (original) +++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java Sun Jun 17 20:31:42 2007 @@ -75,16 +75,6 @@ boolean found = false; int idx = mpi.getMessageInfo().getMessagePartIndex(mpi); - /*while (idx >= inObjects.size()) { - inObjects.add(null); - }*/ - - //fix for testSwaWithHeaders of ClientServerSwaTest - inObjects.add(idx, null); - - if (inObjects.get(idx) != null) { - continue; - } for (Attachment a : message.getAttachments()) { if (a.getId().startsWith(start)) { @@ -110,16 +100,24 @@ o = dh; } - inObjects.set(idx, o); + // If the current index is greater than the # of objects, + // just append the attachment to the end + if (idx >= inObjects.size()) { + inObjects.add(o); + } else { + inObjects.add(idx, o); + } found = true; break; } } if (!found) { - - - inObjects.add(idx, null); + if (idx >= inObjects.size()) { + inObjects.add(null); + } else { + inObjects.add(idx, null); + } } } }