You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dmitry Mamonov (JIRA)" <ji...@apache.org> on 2010/05/18 15:55:44 UTC

[jira] Created: (CODEC-100) Please rename class StringUtils to StringCode or someting (because there is class with same name in commons-lang)

Please rename class StringUtils to StringCode or someting (because there is class with same name in commons-lang)
-----------------------------------------------------------------------------------------------------------------

                 Key: CODEC-100
                 URL: https://issues.apache.org/jira/browse/CODEC-100
             Project: Commons Codec
          Issue Type: Improvement
    Affects Versions: 1.4
            Reporter: Dmitry Mamonov


Duplicate class name in libraries "codec" and "lang":
org.apache.commons.lang.StringUtils
org.apache.commons.codec.binary.StringUtils


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868665#action_12868665 ] 

Gary Gregory commented on CODEC-100:
------------------------------------

I am -1 to changing the class name. Almost all open source projects have a "StringUtils" class: Apache [lang], Antlr, HtmlUnit, wsdl4j, MySQL JDBC driver, Groovy, Plexus, Apache Axis, Apache CXF, Ant, Spring, etc. These are the one on just one of my project's class path.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory closed CODEC-100.
------------------------------

    Resolution: Won't Fix

Will not fix. See comments in this ticket.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Dmitry Mamonov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869034#action_12869034 ] 

Dmitry Mamonov commented on CODEC-100:
--------------------------------------

OK, I give up, but in the end I would like to introduce some code comparison, here is ant's StringUtils:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java?view=markup

One most obscure method:
61 	 public static Vector split(String data, int ch) {
62 	Vector elems = new Vector();
63 	int pos = -1;
64 	int i = 0;
65 	while ((pos = data.indexOf(ch, i)) != -1) {
66 	String elem = data.substring(i, pos);
67 	elems.addElement(elem);
68 	i = pos + 1;
69 	}
70 	elems.addElement(data.substring(i));
71 	return elems;
72 	} 
Such methods return Vector, the legacy List type,  so the real idea of this Utils class is to support code compatibility with old java runtimes,
no one outside of "ant" should use this method (if he has a piece of mind at least).

Methods of org.apache.commons.codec.binary.StringUtils is designed to be widely used in any application, not only
inside "codec" library itself. I think it will be good to name this methods set somehow userfriendly, "*Utils" means nothing
but scrap-heap.

--
P.S. yes, I know, compatibility with previous library versions is important, but tell to yourself, if you would start this project
from scratch now, will you put this methods into StringUtil class or you will find some better name.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Dmitry Mamonov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dmitry Mamonov updated CODEC-100:
---------------------------------

    Summary: Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)  (was: Please rename class StringUtils to StringCode or someting (because there is class with same name in commons-lang))

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868688#action_12868688 ] 

Sebb commented on CODEC-100:
----------------------------

-1 to the proposed change.
I agree with Gregory.
A lot of projects also have Utils or Tools classes.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Dmitry Mamonov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868675#action_12868675 ] 

Dmitry Mamonov commented on CODEC-100:
--------------------------------------

True, all this projects: 
Antlr, HtmlUnit, wsdl4j, MySQL JDBC driver, Groovy, Plexus, Apache Axis, Apache CXF, Ant, Spring 
have their StringUtils class.
But I myself won't use their StringUtils because it is never part of their API (maybe except Spring).

But both in "lang" and in "codec" StringUtils classes is declired to be widely used.

"codec" is a part of apache-commons project (same as "lang") so it will be better to not intersect class names in this projects (and others too).

And, org.apache.commons.codec.binary.StringUtils class has only methods to convert strings to bytes and visa versa.
I think StringCodec name suites this functionallity better than StringUtils.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CODEC-100) Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)

Posted by "Joerg Schaible (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CODEC-100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868797#action_12868797 ] 

Joerg Schaible commented on CODEC-100:
--------------------------------------

-1 for breaking binary compatibility for no better reason. If somebody really has to use both classes in the same Java file, he might use static imports to avoid full class names in the source.

> Please rename class StringUtils to StringCodec or someting (because there is class with same name in commons-lang)
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CODEC-100
>                 URL: https://issues.apache.org/jira/browse/CODEC-100
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Dmitry Mamonov
>
> Duplicate class name in libraries "codec" and "lang":
> org.apache.commons.lang.StringUtils
> org.apache.commons.codec.binary.StringUtils

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.