You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Philippe Gassmann (JIRA)" <ji...@apache.org> on 2005/11/18 16:19:41 UTC

[jira] Created: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

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: Blocker


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


Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 22 Nov 2005, Sylvain Wallez wrote:

> Date: Tue, 22 Nov 2005 17:58:01 +0100
> From: Sylvain Wallez <sy...@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a
>     multivalued field with more than 9 values !
> 
> Giacomo Pati wrote:
>> > 
>> >     [ 
>> >  http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12358249 
>> > ] 
>> > 
>> >  Sylvain Wallez commented on COCOON-1689:
>> >  ----------------------------------------
>> > 
>> >  We have no indication of the JXPath problem that led to avoiding the use 
>> >  of jxpathContext.removePath(). Giacomo, as the author of this change, 
>> >  can you give us more indications on what motivated it ?
>>
>>  This was a workaround due to a bug in JXPath removePath() method reported
>>  by Jeremy and me prior to ApacheCon in Stuttgart. At that time it was
>>  fixed in their repository but not released (and we do not want to have
>>  unreleased jars in our repository). I'll check whether it works with
>>  current jxpath jar.
>
> Thanks!

Workaround is still needed but bug fixed in SVN as reported by Philippe 
Gassmann (a patch would have been appreciated as the bug was quite 
trivial to fix after your analysis). I still didn't found the reason why 
the removeAll methods doesn't remove all items of a Collection (jxpath 
is quite complex). Will file a bug and a test case to commons-jxpath.

Will also try to close jira bug COCOON-1689

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDhF6cLNdJvZjjVZARArpwAJ9Hd9KTEhatBL4c2JwTaD4Bz2jwRACgk54g
HNee/EUtR0K2XZTtKvSVwwU=
=+Yib
-----END PGP SIGNATURE-----

Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by Sylvain Wallez <sy...@apache.org>.
Giacomo Pati wrote:
>>
>>    [ 
>> http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12358249 
>> ]
>>
>> Sylvain Wallez commented on COCOON-1689:
>> ----------------------------------------
>>
>> We have no indication of the JXPath problem that led to avoiding the 
>> use of jxpathContext.removePath(). Giacomo, as the author of this 
>> change, can you give us more indications on what motivated it ?
>
> This was a workaround due to a bug in JXPath removePath() method 
> reported by Jeremy and me prior to ApacheCon in Stuttgart. At that 
> time it was fixed in their repository but not released (and we do not 
> want to have unreleased jars in our repository). I'll check whether it 
> works with current jxpath jar.

Thanks!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://bluxte.net                     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 22 Nov 2005, Sylvain Wallez (JIRA) wrote:

> Date: Tue, 22 Nov 2005 16:14:42 +0100 (CET)
> From: "Sylvain Wallez (JIRA)" <ji...@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: [jira] Commented: (COCOON-1689) Cannot save a cform containing a
>     multivalued field with more than 9 values !
>
>    [ http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12358249 ]
>
> Sylvain Wallez commented on COCOON-1689:
> ----------------------------------------
>
> We have no indication of the JXPath problem that led to avoiding the use of jxpathContext.removePath(). Giacomo, as the author of this change, can you give us more indications on what motivated it ?

This was a workaround due to a bug in JXPath removePath() method 
reported by Jeremy and me prior to ApacheCon in Stuttgart. At that time 
it was fixed in their repository but not released (and we do not want to 
have unreleased jars in our repository). I'll check whether it works 
with current jxpath jar.

>
>> 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.1.9-dev (current SVN), 2.2-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.
>
>

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFDg0PcLNdJvZjjVZARAsQXAKCm7XPfp3RNl61DV9rpUMg39/htSQCfSk2c
ZD+i347W6Rm0F1RvJrn+cJY=
=RRC0
-----END PGP SIGNATURE-----

[jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by "Sylvain Wallez (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12358249 ] 

Sylvain Wallez commented on COCOON-1689:
----------------------------------------

We have no indication of the JXPath problem that led to avoiding the use of jxpathContext.removePath(). Giacomo, as the author of this change, can you give us more indications on what motivated it ?

> 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.1.9-dev (current SVN), 2.2-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


[jira] Aktualisiert: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by "Jörg Heinicke (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1689?page=all ]

Jörg Heinicke updated COCOON-1689:
----------------------------------

    Priority: Minor  (was: Blocker)

> 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.1.9-dev (current SVN), 2.2-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


[jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by "Philippe Gassmann (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/COCOON-1689?page=comments#action_12357980 ] 

Philippe Gassmann commented on COCOON-1689:
-------------------------------------------

Is there really a bug in JXPath removeAll function ?
I cannot find it in the ASF bugzilla.

> 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: Blocker

>
> 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


[jira] Closed: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by "Giacomo Pati (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/COCOON-1689?page=all ]
     
Giacomo Pati closed COCOON-1689:
--------------------------------

    Resolution: Fixed

> 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


Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by Philippe Gassmann <ph...@anyware-tech.com>.
Joerg Heinicke a écrit :

> On 18.11.2005 17:56, Philippe Gassmann (JIRA) wrote:
>
>>     [ 
>> 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.
>
>
> Reducing the severity to minor does not mean that I see your bug 
> report as a joke. The classification results from a comparison with 
> the given priority levels of Jira [1]. From that a blocker "Blocks 
> development and/or testing work." IMO the bug is about a "Minor loss 
> of function" as it is about a very specific part of CForms: only 
> multivalue field and only binding is affected. This does not say 
> anything about how fast this bug will be fixed.
>
> Jörg
>
> [1] 
> http://www.atlassian.com/software/jira/docs/latest/issues.html#PriorityLevels 
>

Ok, I was a little angry about this bug... Sorry
But I think my anger comes from the fact that this functionnality was 
working in 2.1.7 and not in the 2.1.8 release.

Do automatic tests exist in Cocoon ?



Re: [jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by Joerg Heinicke <jo...@gmx.de>.
On 18.11.2005 17:56, Philippe Gassmann (JIRA) wrote:

>     [ 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.

Reducing the severity to minor does not mean that I see your bug report 
as a joke. The classification results from a comparison with the given 
priority levels of Jira [1]. From that a blocker "Blocks development 
and/or testing work." IMO the bug is about a "Minor loss of function" as 
it is about a very specific part of CForms: only multivalue field and 
only binding is affected. This does not say anything about how fast this 
bug will be fixed.

Jörg

[1] 
http://www.atlassian.com/software/jira/docs/latest/issues.html#PriorityLevels

[jira] Commented: (COCOON-1689) Cannot save a cform containing a multivalued field with more than 9 values !

Posted by "Philippe Gassmann (JIRA)" <ji...@apache.org>.
    [ 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