Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 11303 invoked from network); 18 Nov 2005 16:57:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Nov 2005 16:57:11 -0000 Received: (qmail 66549 invoked by uid 500); 18 Nov 2005 16:57:09 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 66470 invoked by uid 500); 18 Nov 2005 16:57:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 66455 invoked by uid 99); 18 Nov 2005 16:57:08 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2005 08:57:06 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id BA502223 for ; Fri, 18 Nov 2005 17:56:44 +0100 (CET) Message-ID: <703018782.1132333004750.JavaMail.jira@ajax.apache.org> Date: Fri, 18 Nov 2005 17:56:44 +0100 (CET) From: "Philippe Gassmann (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values ! In-Reply-To: <1350385226.1132327181232.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12357985 ] Philippe Gassmann commented on COCOON-1689: ------------------------------------------- This bug isn't a joke, and de facto, not a minor bug. > Cannot save a cform containing a multivalued field with more than 9 values ! > ---------------------------------------------------------------------------- > > Key: COCOON-1689 > URL: http://issues.apache.org/jira/browse/COCOON-1689 > Project: Cocoon > Type: Bug > Components: Blocks: Forms > Versions: 2.1.8, 2.2-dev (Current SVN), 2.1.9-dev (current SVN) > Reporter: Philippe Gassmann > Priority: Minor > > An UnsupportedOperationException occurs when trying to save a form containing a multivalued field with more that 9 values. Here is the explanation : > here is the incriminated code in MultiValueJXPathBinding.java:doSave(): > Iterator rowPointers = multiValueContext.iteratePointers(this.rowPath); > List l = new ArrayList(); > while( rowPointers.hasNext() ) > { > Pointer p = (Pointer)rowPointers.next(); > l.add(p.asPath()); > } > Collections.sort(l); > for( int i = l.size()-1; i >= 0; i-- ) > { > multiValueContext.removePath((String)l.get(i)); > } > This code is wrong : > The p.asPath returns something like "/doc/node[x]" > if the iterator contains more than 9 values x will be written in TWO characters so, the result of Collections.sort(l) return for 10 values : > /doc/node[10] > /doc/node[1] > /doc/node[2] > /doc/node[3] > /doc/node[4] > /doc/node[5] > /doc/node[6] > /doc/node[7] > /doc/node[8] > /doc/node[9] > so the first node to be deleted is 9. the last is 10. but when trying to delete the 10th node it does not exist anymore ! > A UnsupportedOperationException is thrown. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira