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
Since Point2D objects can have coordinate values between 0 and 1, I had
to remove the wee optimization of comparing the squares of the distance.
Also modified it so that the origin Point's coordinates can be updated to
update the Comparator.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1853 6335cc39-0255-0410-8fd6-9bcaacd3b74c
int low = Integer.MAX_VALUE - 2; // = 2147483645
int high = Integer.MAX_VALUE; // = 2147483647
int mid1 = (low + high) / 2; // = -2
int mid2 = low + (high - low) / 2; // = 2147483646
int mid3 = (low + high) >> 1; // = -2
int mid4 = (low + high) >>> 1; // = 2147483646
So we'll use the last one (non-sign-propagating shift) as it is likely to be
fastest and clearest.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1850 6335cc39-0255-0410-8fd6-9bcaacd3b74c
line as the thing we're suppressing, to more closely couple them.
Also, removed one hanging on a method by using a temporary variable within.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1848 6335cc39-0255-0410-8fd6-9bcaacd3b74c
is Boolean, Byte, Short, Character, Integer, Long, Float, or Double.
This has always made sense for Boolean, but with 1.5 they added these
methods everywhere and they are the preferred method for obtaining an
instance of any of those classes unless you absolutely want different
object references.
Since many Integer objects have a low value, the small bit of overhead
incurred for calling these methods should more than make up for itself
in saved memory and garbage collection time.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1847 6335cc39-0255-0410-8fd6-9bcaacd3b74c
an Entry interface that can be used to get the count directly from
an Entry (without having to know that values are stored internally as
an int[]). It turned out to be a bit ugly.
What I really need to do is hide all the int[] business by rewriting
this class, which will also clean up the ugliness.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1839 6335cc39-0255-0410-8fd6-9bcaacd3b74c
JDBC connection at a time. JDBC connections are thread safe, but we frequently
have to execute statements like:
insert into FOO values(0, blah, blah);
select LAST_INSERTED_ID()
to get the value assigned to an auto-increment column. If another thread
slipped in between those statements and inserted something into its own
auto-increment column having table, we'd get funny business. And indeed we very
occasionally see this race condition happen in the thread-happy webapps.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1838 6335cc39-0255-0410-8fd6-9bcaacd3b74c