You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Andres Almiray (JIRA)" <ji...@apache.org> on 2006/07/25 18:56:19 UTC

[jira] Created: (LANG-274) Support for multidimensional array conversion

Support for multidimensional array conversion
---------------------------------------------

                 Key: LANG-274
                 URL: http://issues.apache.org/jira/browse/LANG-274
             Project: Commons Lang
          Issue Type: New Feature
            Reporter: Andres Almiray
            Priority: Minor


Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.

This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-274) Support for multidimensional array conversion

Posted by "Andres Almiray (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-274?page=comments#action_12423476 ] 
            
Andres Almiray commented on LANG-274:
-------------------------------------

Yes, the patch would be rather large.
I'll try pitching the idea on the commons-dev list as you suggest.

> Support for multidimensional array conversion
> ---------------------------------------------
>
>                 Key: LANG-274
>                 URL: http://issues.apache.org/jira/browse/LANG-274
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Andres Almiray
>            Priority: Minor
>
> Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.
> This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-274) Support for multidimensional array conversion

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-274?page=comments#action_12423402 ] 
            
Henri Yandell commented on LANG-274:
------------------------------------

Thanks for the suggestion Andres. It's always very cool to see suggestions from other open source projects.

I'm +1 to being able to move from [] to [][][][]....[] for Lang 2.3. Any chance of a patch for ArrayUtils and ArrayUtilsTest?

Failing that, which particular code are you suggesting from the json-lib converter framework? One thing we've tried hard to do with Lang is to not create large numbers of interfaces that the user has to learn about and extend. Instead it focuses on having lots of useful functions that can be used in any situation.

There was also a converter project started that we really need to try and figure out how to move again as its something that people need.

> Support for multidimensional array conversion
> ---------------------------------------------
>
>                 Key: LANG-274
>                 URL: http://issues.apache.org/jira/browse/LANG-274
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Andres Almiray
>            Priority: Minor
>
> Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.
> This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-274) Support for multidimensional array conversion

Posted by "Andres Almiray (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-274?page=comments#action_12423455 ] 
            
Andres Almiray commented on LANG-274:
-------------------------------------

Henry,

There is a facade, ConvertUtils, that works very similar to its counterpart on beanutils. All the converters extend the Converter interface, but that is just a marker interface, the convert method of each implementation is intended to be invoked by reflection or by direct type manipulation, because the primitive converters return a primitive value, not a wrapper. The array converters depend on the primitive ones.
Another advantage of the primitive converters is that they accept Number, String and they respective wrapper as inputs.
In the end, a user just needs to know about ConverterUtils and that Converter implementations hava a convert( Object value ) method (by convention) that returns the correct value. 

I believe the other project is commons-convert, still on sandbox since 2005.

I'll be very happy to provide a patch using the json-lib code as a starting base. An option that comes to mind is refactor the current toPrimitive/toObject methods so they delegate the work to the specific arrayConverter. And maybe add a general array conversion for Number[] and String[].

Please let me know what you think of this approach.

> Support for multidimensional array conversion
> ---------------------------------------------
>
>                 Key: LANG-274
>                 URL: http://issues.apache.org/jira/browse/LANG-274
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Andres Almiray
>            Priority: Minor
>
> Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.
> This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (LANG-274) Support for multidimensional array conversion

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LANG-274?page=comments#action_12423472 ] 
            
Henri Yandell commented on LANG-274:
------------------------------------

Generally my thinking is either:

* If it's a small patch, then it's a good target for ArrayUtils in Lang. 
* A larger patch/framework would be a rejuvenation of commons-convert.

The last week or so of Finder has shown me that the best thing can be to kick off a Sandbox project, watch people tear it apart, and then magically the core of what you wanted to get into a component ends up there anywhere (DirectoryWalker and various filters in IO).

Assuming you're talking about a large patch (sounds like you are) - would you have the time to start a thread on commons-dev about the current commons-convert, the json-lib code and any thoughts you might have concerning a conversion component?

> Support for multidimensional array conversion
> ---------------------------------------------
>
>                 Key: LANG-274
>                 URL: http://issues.apache.org/jira/browse/LANG-274
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Andres Almiray
>            Priority: Minor
>
> Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.
> This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Resolved: (LANG-274) Support for multidimensional array conversion

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LANG-274?page=all ]

Henri Yandell resolved LANG-274.
--------------------------------

    Resolution: Won't Fix

Resolving this one as a wontfix - instead we'll discuss convert APIs on commons-dev.

> Support for multidimensional array conversion
> ---------------------------------------------
>
>                 Key: LANG-274
>                 URL: http://issues.apache.org/jira/browse/LANG-274
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Andres Almiray
>            Priority: Minor
>
> Only unidimenisional array conversions are supported by ArrayUtils. I recently had the new for this and seeing that Lang does not support the feature, I hacked it myself (please see json-lib's <a href="http://json-lib.cvs.sourceforge.net/json-lib/json-lib/">cvs</a>/<a href="http://json-lib.sourceforge.net/apidocs/net/sf/json/converter/package-frame.html">javadoc</a> for reference). I think that this feature may be useful to others and that json-lib is not the correct project for it.
> This issue is at the boundaries between lang and beanutils. Lang allows the conversion of an unidimensional array between wrappers and primitives. BeanUtils allows conversion from String to unidimensional arrays. As BeanUtils is more fragile then Lang I thought this was the correct place to post the issue.

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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org