Commit Graph

693 Commits

Author SHA1 Message Date
mdb 52b9886246 We need this suppression.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2357 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-06 22:11:43 +00:00
mdb ca764911c8 From Dave: a bunch of @Override annotating and some other cleanup.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2356 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-06 12:59:06 +00:00
mdb 3a283a16e1 Trimmed trailing whitespace.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2355 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-04 12:37:23 +00:00
mdb e212e29de8 Fixed some bogus null checks and assignments.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2353 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-04 00:49:37 +00:00
mdb 5f88cdb856 The target result listener is not necessarily of the same type as the chaining
listener.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2352 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-01 12:48:46 +00:00
mdb b821084d39 Handle uncomplicated wildcard types.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2351 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-30 14:33:54 +00:00
mdb 1d146da100 Le metric crapload of generics cleanup.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2350 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-30 13:53:24 +00:00
mdb 4ff9dd2bc7 Cleaned up a few more type safety bits.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2349 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-26 22:27:52 +00:00
mdb 9ef52a4929 Some type parameter clarification.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2348 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-26 22:11:38 +00:00
mdb 10eeeca31b Nixed a bunch of unused variables.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2347 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-26 22:02:39 +00:00
mdb 784698c730 Untabification, unused variable cleanup.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2346 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-26 20:26:26 +00:00
mdb 9e034ea863 Unused import pruning.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2345 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-26 20:14:38 +00:00
ray 82bd4c7f1f More changes requested by the puzzle pirates.
- Added ArrayUtil.indexOf(int[], int).
This has never been added, in all our years, because it exists in IntListUtil.
IntLists are sort of different from int[]s, they're designed such that a 0
is an empty slot. But indexOf() works the same in either one, so let's make
ArrayUtil the definitive container of this code, and have IntListUtil use
ArrayUtil.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2344 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-23 23:39:45 +00:00
ray a60b9da150 Per Micah Weaver, added getWeightedIndex(int[], Random);
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2343 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-23 22:27:57 +00:00
ray e04f56ce4f Patch from Charlie Groves:
Convenience method to schedule a non-recurring Interval at a specific time.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2342 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-23 21:49:27 +00:00
ray e67458d55f Patch from Charlie Groves:
mdb's changes to GenUtil yesterday are causing it to choke when making type
  names for arrays and causing genservice to blow up in yohoho.  This checks
  for the subclass of Type for arrays and properly generates a name for it.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2341 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-23 18:59:11 +00:00
ray 05357b597d Genericized, from Charlie.
Also de-microsofted the line endings.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2340 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-23 18:13:52 +00:00
mdb b5069d97b3 Dramatically simplified name simplification and in the process fixed the
handling of generic type arguments.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2339 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-22 13:47:20 +00:00
zell b619e1da06 Handle SEQUENCE strategies, which are not yet implemented. This'll fix David Hoover's super-strict compilation urges, besides being a generally good idea.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2338 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-21 19:36:47 +00:00
ray 30ae1be3c8 Patch from Charlie Groves:
- Makes the button arg on GroupLayout.makeButtonBox a vararg so multiple
  buttons can be passed in at creation time.  It also adds a version using
  center justification as the default since that's what we do about 80%
  of the time in yohoho.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2337 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-18 18:30:04 +00:00
mdb 69930d1f76 Made DEFAULT_GAP public.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2336 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-18 17:51:04 +00:00
zell 744c4cf3d5 Always do a (potentially distributed) cache remove on invalidation, regardless of what's in the local cache. From Kyle Sampson.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2335 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-17 12:16:39 +00:00
ray fbce967233 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2334 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2008-07-15 00:03:10 +00:00
mdb e84f6ff16b Use the platforms line separator character(s).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2333 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-08 10:27:55 +00:00
ray 6717fecd06 Patch from Charlie.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2332 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-03 18:10:55 +00:00
mdb 872cd06201 Properly case our userid query.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2331 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-07-03 07:15:49 +00:00
mjohnson e8e1e766e4 Use StringBuilder. Added a comment saying you most likely don't want to use wordWrap.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2330 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-25 21:27:01 +00:00
mjohnson 7ad4e741ad Added a simple wordWrap function to StringUtil
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2329 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-25 21:00:20 +00:00
andrzej 07e6a574db No need to obscure the fact that's a HashMap.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2328 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-17 00:46:02 +00:00
andrzej 7325f92676 Added an accessor for the underlying map.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2327 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-17 00:44:14 +00:00
ray 97ae34fcdd Name that thread.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2326 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-13 01:01:14 +00:00
ray 9e41658569 Formatting adjustments, courtesy of Dave Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2325 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-10 20:40:13 +00:00
ray 7202cbd84e There's an indexOf in ListUtil, but that cannot find a null in an array.
Here's one suggested by Dave.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2324 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-10 20:28:57 +00:00
mdb 4aedf764ec Let's name our factory methods along the same lines as the pattern established
by Maps and friends.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2323 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-07 10:24:59 +00:00
mdb f4ba889deb Added static constructor methods that make ObserverList construction
substantially less keystroke intensive.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2322 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-07 10:22:14 +00:00
mdb 95452a37b8 Make it possible to configure our log factory programmatically.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2321 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-06 21:54:38 +00:00
andrzej e0a4516eaf Accept "t" for true in parseBooleanArray, since that's what
toString(boolean[]) emits.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2320 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-06-05 02:43:33 +00:00
mdb 0769979b03 Added countEntrySet() so that you can do:
for (CountHashMap.Entry entry : cmap.countEntrySet()) {

which you can't do with the somewhat butchered current entrySet()
implementation. Indeed, I'm not sure quite how one is supposed to use that.
Perhaps in an iterator and cast the result to a CountHashMap.Entry?


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2319 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-30 14:03:56 +00:00
ray 4f0164737c Protection for applet mode.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2318 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-29 01:43:19 +00:00
mdb b1f9ac47a3 If we tell log4j who we are, it will figure out the caller properly.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2316 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-28 18:33:07 +00:00
mdb 84597c3b99 Added log4j support to the log wrapper. It is enabled if the log4j
configuration system property is set (and a particular logger is not
specifically configured).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2315 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-28 18:02:37 +00:00
mdb 301a695cd8 Accept our new logger as well as Java loggers.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2314 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-27 19:36:54 +00:00
mdb 9a5968fe08 Use new logging shim.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2313 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-27 18:40:39 +00:00
mdb 4af8953a19 A simple log wrapper that allows samskivert itself and libraries that depend on
samskivert to use logging services without creating a dependency on a logging
implementation.

This is basically what JCL (Jakarta Commons Logging) does except they do
auto-detection based on what's in the classpath and we're only going to
auto-detect log4j and only use it if we see that a log4j configuration has been
provided via a system property (or maybe not at all, I'm not sure yet). The
point is avoid the major gripe about JCL which is that when you stick some
logging system's jar file into your classpath for some other dependency (or
it's there for unknown reasons like maybe your servlet container uses it), all
of a sudden your log output disappears or breaks.

I had an idea while doing this and couldn't resist slipping it in: all of the
logging methods take varargs additional parameters which are a set of key/value
pairs to append to the log message in our standard format with an optional
final exception to be logged as well.

So instead of:

  log.warning("Oh crap, the fibbleminscher has exploded [state=" + 15 + 
              ", monkeys=" + StringUtil.toString(_monkeys) + "].");

You do:

  log.warning("Oh crap, the fibbleminscher has exploded.", "state", 15,
              "monkeys", _monkeys);

The formatter automatically does the StringUtil.toString magic on the arguments
(and does it safely so that if toString throws an exception the log message
isn't lost). You can also throw an exception in the mix:

  log.warning("Oh crap, the fibbleminscher has exploded.", "state", 15,
              "monkeys", _monkeys, ioe);

Or supply one with no parameters:

  log.warning("Oh mammy!", ioe);

Or even just log an exception if you have nothing pithy to add:

  log.warning(ioe);

Some research shows that other people have started doing this in their logging
systems as well under the fancier name of parameterized logging. The big
benefit is that you can pass objects that are expensive to toString() and avoid
toString()ing them unless you're actually going to generate the log message.
In our case we also get the benefit of our standard formatting and less
cluttered code (begone lots of + ", ...=" + typing).

I'm going to be doing away with the old samskivert Log code and converting all
of our libraries (and projects) to use this new shim so that we can easily
switch to using log4j, which for other reasons we want to use instead of Java's
built-in logging.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2311 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-27 18:36:32 +00:00
ray 7adef99c05 Per Charlie's suggestion, throw an unchecked exception if schedule() is called
with fixedRate=false when a RunQueue has been specified.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2309 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-20 21:21:06 +00:00
ray 97684500b6 Added a note explaining why this may not actually work as Charlie wants it to
without some restructuring of his code.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2308 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-20 19:38:42 +00:00
ray c074f73bcb Patch from Charlie Groves to expose Timer's ability to schedule at a
fixed delay. We haven't needed this before now.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2307 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-20 19:34:23 +00:00
ray f37ba48cce git-svn-id: https://samskivert.googlecode.com/svn/trunk@2306 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2008-05-19 18:32:58 +00:00
mdb c51b652abd Created a unit for when we just want to write something to the database and do
nothing with the results.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2305 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-05-18 11:11:28 +00:00
ray 328fae15e6 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2303 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2008-05-16 03:20:27 +00:00