-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 21 Jul 2005, Giacomo Pati wrote:

I've tried to add a bug to bugzilla for commons-jxpath but connection
here at ApacheCon has prevented me until now. But sure it's still on my
todo list :-)

After reestablishing network connection here at ApacheCon I was able to check the current commons-jxpath code base. It seem the bug is already fixed there. Is somebody on commons-jxpath ML and can answer when that code base gets released so that I can revert my workaround?

Ciao

Giacomo


Thanks

Giacomo


 Best Regards,

 Antonio Gallardo

 [EMAIL PROTECTED] wrote:

>  Author: giacomo
>  Date: Wed Jul 20 01:19:35 2005
>  New Revision: 219856
> > URL: http://svn.apache.org/viewcvs?rev=219856&view=rev
>  Log:
>  added workaround for a bug in commons-jxpath's
> JXPathContext.removeAll(path) which isn't really removing all elements > from
>  a Collection type object
> > Modified:
>      
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>      
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
> > Modified:
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>  URL:
>  
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java?rev=219856&r1=219855&r2=219856&view=diff
>  
==============================================================================
>  ---
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>  (original)
>  +++
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>  Wed Jul 20 01:19:35 2005
@@ -15,8 +15,11 @@
>   */
>   package org.apache.cocoon.forms.binding;
> > +import java.util.ArrayList;
>  +import java.util.Collections;
>   import java.util.Iterator;
>   import java.util.LinkedList;
>  +import java.util.List;
>   import java.util.Locale;
> > import org.apache.avalon.framework.logger.Logger;
@@ -104,7 +107,23 @@
>           JXPathContext multiValueContext =
>           jctx.getRelativeContext(jctx.createPath(this.multiValuePath));
> > // Delete all that is already present
>  -        multiValueContext.removeAll(this.rowPath);
> + + // Unfortunately the following statement doesn't work > (it > doesn't removes all elements from the + // list because of a bug > in
>  JXPath) so I had to work out another immediate solution
>  +        //multiValueContext.removeAll(this.rowPath);
>  +        +        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));
>  +        }
> > boolean update = false; > > > Modified:
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
>  URL:
>  
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java?rev=219856&r1=219855&r2=219856&view=diff
>  
==============================================================================
>  ---
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
>  (original)
>  +++
>  
cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
>  Wed Jul 20 01:19:35 2005
@@ -30,6 +30,8 @@
>   import org.mozilla.javascript.Undefined;
>   import org.mozilla.javascript.Wrapper;
> > +import java.util.Collection;
>  +
>   /**
>    * @version $Id$
>    *
@@ -256,6 +258,8 @@
>                       }
>                   } else if (value instanceof Object[]) {
>                       values = (Object[])value;
>  +                } else if (value instanceof Collection ) {
>  +                    values = ((Collection)value).toArray();
>                   }
>                   field.setValues(values);
>               } else {
> > >


--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
--[PinePGP]-----------------------------------------------------------
gpg:  Signature made Thu Jul 21 11:20:33 2005 CEST using DSA key ID 98E35590
gpg:  Good signature from "Giacomo Pati <[EMAIL PROTECTED]>"
gpg:                  aka "Giacomo Pati <[EMAIL PROTECTED]>"
--[PinePGP]----------------------------------------------------[end]--



- -- 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.1 (GNU/Linux)

iD8DBQFC33ykLNdJvZjjVZARAiL3AJ0U+PqUHsBCXTc1FLyRw8j/PjaBPACdGPFY
7oaXfe6Mor/C/nmIQQc3CC8=
=JN32
-----END PGP SIGNATURE-----

Reply via email to