same methods. But then I went ahead and added String varargs versions,
otherwise any old code that passes a String[] would have to cast to
Object[] to avoid compiler warnings. (Because the args don't quite match,
the compiler is unsure whether you want your String[] to be the first Object
arg or whether the whole String[] should be cast to the Object[].)
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1901 6335cc39-0255-0410-8fd6-9bcaacd3b74c
certainly *never* what you want. However, I don't know who's calling these
methods (and they are doing so through Velocity so I can't just recompile
everything to find out; yay for dynamic languages), so I won't remove them
outright. I did remove the dangerous methods from CurrencyUtil.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1896 6335cc39-0255-0410-8fd6-9bcaacd3b74c
I originally had append have the signature:
public static <T extends Object, E extends T> T[] append (
T[] values, E value)
At first I thought I had done a good thing by ensuring that a subclass
element could be added, but then realized that E was pointless because
an E can be passed in for the T parameter anyway.
That got me thinking about generics and I found this:
http://weblogs.java.net/blog/arnold/archive/2005/06/generics_consid_1.html
Some of it made me laugh, and while I didn't read all the comments, I
spotted this gem:
[excerpt]
The trouble with generics--and this has been known for many years--
is what I'd like to call the Elvis/Einstein boundary. (Google for
Mort/Elvis/Einstein if you wonder why the King enters the picture...)
List<E>. solves a problem that Elvis had: What the !@#$ is in that
collection?
But before he knows it, he is at
<T> int binarySearch(List<? extends Comparable<? super T>> list, T key).
That`s for Einstein, not Elvis.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1895 6335cc39-0255-0410-8fd6-9bcaacd3b74c
the string is tested against maxLength, but is trimmed at a point
such that the result string will be maxLength after the addition of
the 'append' parameter.
I'm pretty sure nothing (around these parts) depended on the old behavior.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1894 6335cc39-0255-0410-8fd6-9bcaacd3b74c
Sometimes we used the apache predicate, sometimes we rolled our own.
I'm rolling our own now because I want generic support.
Implementation details are subject to change, but two that we may want
to discuss sooner than later:
- I called the arbitration method "isMatch()", but almost went with
"evaluate()" and considered "is()".
- I made Predicate an abstract class rather than an interface because I felt
it was cool to be able to create filtered Iterators or views of collections
using the Predicate.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1893 6335cc39-0255-0410-8fd6-9bcaacd3b74c
For observer lists, we do not care if two observers happen to
implement equals() such that they agree to be the same, we care
only if they're the exact same observer.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1891 6335cc39-0255-0410-8fd6-9bcaacd3b74c
used to prepend "handle" to an action and then look up the method (which we
still support) but now we also check for a method just named directly after the
action.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1890 6335cc39-0255-0410-8fd6-9bcaacd3b74c
automatically clear entries on get(). Since the point of this is to be a cache
and not to be iterable, we will simply remove all but the safe and necessary
functionality to keep people out of trouble.
Keep it simple! Put things it, get them out. Or not.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1886 6335cc39-0255-0410-8fd6-9bcaacd3b74c
be garbage collected. If you iterate over the keys, values or entries, you have
to cope with interleaved null values, doing the "right" thing there is a bit
PITA and iterating over the cache is wacky anyway because size() will most
likely never be right (unless we validated every entry in the cache at the time
you called size() which is also wacky).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1885 6335cc39-0255-0410-8fd6-9bcaacd3b74c
as it caught the 0/0 case and freaked out in the >0/0 case. I'll just
sheepishly change this all back and go fix the fucking webapp that's passing
1/0.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1873 6335cc39-0255-0410-8fd6-9bcaacd3b74c
numerator is stupid because the math just works, so we'll keep the new behavior
and change the documentation because I'm tired of seeing giant div0 exceptions
in the logs and the fix will no doubt to be to find those places and change
them to display zero if the denominator is zero which is exactly what we're
doing here anyway. It's the new math.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1871 6335cc39-0255-0410-8fd6-9bcaacd3b74c
translation message. So you can define something like:
m.coins = Doubloons
m.buy_coins = Purchase {m.coins}
and then later override m.coins and all instances of it will be properly
changed. Very useful for our rebranding efforts.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1858 6335cc39-0255-0410-8fd6-9bcaacd3b74c
using site bundles. The message manager will now allow a simpler form of
site-specific messaging wherein it prefixes the site string to the message
bundle and looks for that (assuming we're not using site bundles).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1857 6335cc39-0255-0410-8fd6-9bcaacd3b74c
Deprecated versions of the methods in StringUtil will continue to take
a StringBuffer argument for now.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1855 6335cc39-0255-0410-8fd6-9bcaacd3b74c