commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] is there a release on the visible horizon?
Date Sun, 30 Jun 2002 23:29:33 GMT
From: "Henri Yandell" <bayard@generationjava.com>
> On Sun, 30 Jun 2002, Stephen Colebourne wrote:
> > 1)  rename method in Objects
> > - change isNull() to defaultIfNull()
>
> +1.
Done

> > 6) Numbers has a lot of comments about future things. Plus
containsDigits()
> > has question marks against the null handling
>
> Question marks meaning, should containsDigit consider null to contain
> digits or not, or should it not even check.
Or should it throw an exception (and which one)


> > 9) Constant
...
> Biggest issue to me on Constant is that I have discovered it has
> Serialisation problems, might have to scrap it for this alone as I've not
> found a solution without making it an Enum structure.
I would favour a structure more like Enum. Maybe I should checkin my
classes, and they could be -1ed or Constant removed as appropriate.


> > 10) Strings - some methods are very specific (too specific) and could be
> > removed
> > - parseObjectKey
> > - removeUnderscores
>
> These are quite old. We might want to enquire as to who is dependant on
> them and then kill them.
How do we do that? Just delete them and see if anyone complains?

> > - reverseDottedName, reverseDelimitedString will do this so is dot a
valid
> > special case
>
> Sounds good.
TODO

> > - interpolate - this seems to be very specific to a particular syntax
>
> I think it is quite a standard syntax, but also not something that needs
> to live inside Strings. org.apache.commons.util.BasicInterpolator would be
> my vote.
TODO

> > Some methods have misleading names
> > - isValid() - should be isNotEmpty(), a not empty string is not
necessarily
> > valid
> +1.
TODO

> > Some methods could be optimised:
> > - capitalise
> > - uncapitalise
> > - overlayString
> Go for it. I don't pretend to be a great algorithm coder.
TODO

> > Some methods may be wrong:
> > - chomp/chompLast  hard codes \n rather than uses System.LINE_SEPARATOR
> > - wordWrap  hard codes \n rather than uses System.LINE_SEPARATOR
>
> Definitely for LINE_SEPARATOR. chomp stuff needs a bit of investigating as
> I was following the PHP versions a bit closely.
TODO (change to LINE SEP)
I'll let you worry about the methods in general.

> > The class seems too big. Maybe some smaller associated utility classes
would
> > be appropriate?
> > CharSet methods seem to be a group. Could they be in their own class?
Also
> > why is evaluateSet public when a CharSet cannot be passed in anywhere.
>
> CharSet used to be a public class. It was put into Strings for
> organisational purposes while it lived in the Util project and hasn't been
> broken out again.
But do you agree with a new class taking the static methods as well? In fact
do they become instance methods?

> > (PatternStringUtils)
> > Maybe the casing methods could be broken out?    (CaseStringUtils)
>
> People expect these to be in Strings I think.
They do form a nice group. And could be broken out.

 > > Maybe the random methods could be broken out?   (RandomStringUtils)
>
> I think this would be a good thing.
TODO

> > Add
> > - left(String, int len), right(String, int len) and mid(String, int
from,
> > int len) to Strings, no exceptions  (as per BASIC)
>
> So what do these do? Didn't have them in BBC BASIC in 1984 :)

Yes you did ;-) And on the Archimedes too.
left(String str, int len)  is the same as substring(0, len) but returns the
string without exceptions if length < len
right(String str, int len)  is the same as substring(str.length() - len) but
returns the string without exceptions if length < len
mid(String str, int start, int len)  is the same as substring(start, len)
but returns the remainder of the string without exceptions if len chars not
available

> > - isAlphanumericSpace/isNumericSpace, for specifically space and not
> > whitespace
> > - contains(String, String), does the first string contain the second
>
> +1 to both.
TODO



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


Mime
View raw message