Commit Graph

1078 Commits

Author SHA1 Message Date
David Hoover b76ab3cdac No longer pick from arrays.
Per the wailing and gnashing of teeth in response to 7e51d4c and 7bb7ee2,
I'll do the extra legwork to keep my bits in a List despite java handing
them to me as an array.
2011-08-23 13:33:11 -07:00
Michael Bayne 7e51d4c624 Compaction. 2011-08-23 11:15:13 -07:00
David Hoover 7bb7ee2ad8 Support picking from arrays. 2011-08-23 10:52:54 -07:00
Pär Winzell ad377342dd Implement initValue for HSQL identity generators. 2011-07-21 15:55:46 -05:00
mthomas cca1a46592 Add missing @Override 2011-06-23 11:46:48 -07:00
Michael Bayne 024e2ad3c4 Trimmed trailing whitespace. 2011-06-21 17:13:35 -07:00
Michael Bayne 67a450df2c I can't resist some compaction here. 2011-06-21 17:12:14 -07:00
mthomas e570924919 Fix my last commit, which apparently had a stale version of the JDBCUtil class... 2011-06-21 16:26:31 -07:00
mthomas 4a24b8b942 Merge branch 'master' of github.com:threerings/samskivert 2011-06-21 16:24:05 -07:00
mthomas 70f7c38fbf Add a new quote() method which converts a date to a quoted string. 2011-06-21 16:19:50 -07:00
Michael Bayne 402cdfdc29 Be explicit about our Interval usage.
In AuditLogger, we roll over the audit log on the Interval timer thread, which
is dubious, because it could block, but introducing an Invoker thread here
would require a ticket on a boat that sailed a long time ago. In the case of
SerialExecutor, we're just doing Thread.kill() on the Interval timer thread, so
that's fast enough.
2011-06-17 12:24:24 -07:00
Michael Bayne 85efd40adf Better interval behavior.
If no runqueue is supplied on which to prune sessions, we don't schedule a
session pruner, rather than scheduling a long running database action on the
Interval timer thread, thereby booching all other Intervals.
2011-06-17 12:23:09 -07:00
Michael Bayne 4a53f9c29b Revamped Interval to force the creator to explicitly indicate that they want to
run on the interval timer thread, rather than allowing that to be the default
behavior if they forget to supply a RunQueue to the constructor.

Running on the interval timer thread is only safe if you know your interval
will complete very quickly, because you'll delay the firing of all other
intervals until your interval finishes. This is almost never what you want.
2011-06-17 12:22:48 -07:00
David Hoover d63f147cae Unused import 2011-06-02 09:16:10 -07:00
David Hoover af3c9e88f0 Speeling 2011-06-02 09:05:49 -07:00
David Hoover e308ab9bf3 Whitespace 2011-06-02 09:05:49 -07:00
Michael Bayne 8c9c2a42b0 - Added missing handling for char[] in toString.
- Fixed wacky use of short index variable in toString's short[] handling.
- Ensured that custom separator and whether or not we're traversing collections
is properly passed to recursive calls.
2011-06-01 12:15:28 -07:00
Michael Bayne 881ee30047 Modified toString() such that the no-box-arguments versions do not
automatically traverse collections, but instead simply call toString on them.
The versions that take box arguments (where the developer is clearly expressing
a desire for custom formatted collections) still do the traversal. Moved the
warning that Enumeration and Iterator are consumed into said methods.

Switched LogBuilder to use StringUtil.toString, since it now subsumes the
behavior of ArrayUtil.toString without the undesirable collection munging that
motivated its original creation.

Nixed ArrayUtil.toString/safeToString because they haven't been in the wild
long enough to be likely to have been discovered and used by third parties.
2011-06-01 11:40:26 -07:00
Michael Bayne 49083d9105 Let's remove this and see what happens. Whee! 2011-04-27 07:55:47 -07:00
Michael Bayne d79cb9aa0e Added Factory interface here. I will remove it from Narya shortly. 2011-04-27 07:53:33 -07:00
Michael Bayne 5a9665f803 Yay for sneaking type parameters in with 1.6, and yay for having to remain
backwards compatible with 1.5.
2011-04-10 12:39:07 -07:00
Michael Bayne 9059d5ac4d JList and ListModel have type parameters. Let's use 'em. (I'll fix the one
client that lives in the bowels of Yohoho.)
2011-04-08 18:04:32 -07:00
Michael Bayne 6b86064c33 Do this in a way that the Java 7 compiler is less angry about. 2011-04-08 18:04:12 -07:00
Michael Bayne dc1e8bfde1 We need parameters on that thar return type. 2011-04-08 17:56:46 -07:00
Michael Bayne 0e1baccf4b Allow duplicate checking to be disabled for performance reasons. The profiler
has spoken.
2011-04-08 17:48:07 -07:00
Michael Bayne 5c99fd31df Let's switch to a compact header style I've adopted for more recent projects. 2011-04-06 20:10:41 -07:00
Charlie Groves 3b8c5b3121 Unused imports 2011-04-06 18:18:31 -07:00
Charlie Groves f564c5f337 Clippy sez you might want a parameter there 2011-04-06 18:07:39 -07:00
Bruno Garcia 1740c2cda7 Trailing whitespace, the invisible menace. 2011-04-05 17:34:52 -07:00
Deadmoose 74ae8bc0bb No $Id$ in git. And update some stale copyright while I'm at it. 2011-04-05 15:49:23 -07:00
Michael Bayne 24f406aae2 Removed the ability to allow duplicates. That was introduced in a fit of
waffling ages ago and has never been used, and for good reason.
2011-04-05 14:44:44 -07:00
Michael Bayne 739007a000 Preserve int-ness of policy constants and newList() signature, add isEmpty().
This will hopefully take us as far down the road of backwads binary
compatibility as needed.
2011-04-05 13:47:26 -07:00
Michael Bayne 9c6b7a9603 Ray sez:
- ObserverList shouldn't extend ArrayList; bad mojo.
- Policies should be an enum.
- Use CopyOnWriteArrayList instead of our hand-rolled snapshotting.
MDB addends:
- ObserverList should be an interface (turned out to be easier to make it an
abstract class).
- WeakObserverList should be simpler, and turns out to be so, once we simplify
ObserverList public interface and remove ArraListness.

This should all be source compatible with previous usage (modulo deprecation of
the ObserverList notification constants, which most code is probably not using,
since the nice factory methods are much more concise).
2011-04-05 12:09:38 -07:00
Deadmoose 71e3d2ca29 Speeling 2011-04-04 22:31:20 -07:00
samskivert cab1a00aac Handle TypeVariable in simpleName().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2994 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2011-04-02 02:00:45 +00:00
ray.j.greenwell cd0d699c77 - Parse enums.
- Rejigged some strange code in Color parsing.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2993 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2011-03-25 18:47:58 +00:00
andrzej@threerings.net 227a8fa447 Store the class name of the interval so that we can identify it after
cancellation.  It's tempting to store the string representation as
well when the reference is cleared, but that could be anything, so
avoid the expense.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2992 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2011-03-22 22:01:47 +00:00
ray.j.greenwell e02fb89cb0 PECS, and use Collections.reverseOrder().
There are actually 5 different implementations of quicksort in here when
one will do (the array versions could go away and call the list version,
wrapping in Arrays.asList()). But I won't touch those right now. I am
super tempted to reduce things down to one List version and one array
version.

Also it's weird that there are customized Comparators that are null-safe.
I believe I was the one who added them in the past, but I've since learned.
It's a strange undocumented "convenience" when it's easy enough for someone
to provide a null-safe comparator for comparables. (In guava you can call
Ordering.natural().nullsLast()).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2988 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2011-01-26 20:36:37 +00:00
karma@deadmoose.com a2764d78bb Auld Lang Syne
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2974 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2011-01-01 05:09:33 +00:00
samskivert 939f501ae4 Pass the property key along via the exception.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2973 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-19 19:26:11 +00:00
samskivert 4871bc817f Added requireProperty() and associated MissingPropertyException.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2972 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-19 19:12:10 +00:00
samskivert df7df145e6 Widening.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2971 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-19 18:58:04 +00:00
ray.j.greenwell cb82f080d6 Added ArrayUtil.safeToString(), which encapsulates the logic to check if it's an array.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2970 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-15 01:57:47 +00:00
ray.j.greenwell 059d557ec9 LogBuilder.arrayStr() -> ArrayUtil.toString(), made public.
If Java were invented today, you can be damn sure the array classes
would have reasonable hashCode(), equals(), and toString() implementations,
instead of falling back to Object's.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2969 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-15 01:17:31 +00:00
karma@deadmoose.com b84a696da2 Argh. 1.5 has setIconImage on Frame, not Window.
It's not that it didn't exist, it just used to be on Frame. So when
I did all my 1.5 testing, I was working with a JFrame, and then at the
11th hour decided to make this function take as general a thing as
possible, so I merrily climbed up the tree in 1.6 & didn't notice that
change.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2965 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-02 19:26:46 +00:00
charlie.groves 37e5e05998 Both the List and Image versions of setIconImage were introduced in 1.6, so it's reflection or
nothing.



git-svn-id: https://samskivert.googlecode.com/svn/trunk@2964 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-02 02:33:59 +00:00
karma@deadmoose.com 88628a38f4 Add a helper to set window icons.
As the comments say, it tries to use the nicer stuff that was added in
1.6, but falls back as needed.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2963 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-02 01:22:09 +00:00
karma@deadmoose.com c1dbc51da7 Pretty sure truthiness is never null.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2961 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-01 01:00:57 +00:00
samskivert ebdbd964b5 Do our null checking less wonkily.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2959 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-12-01 00:43:12 +00:00
ray.j.greenwell 6e4739870a You put T in, you get T out.
I'm open to suggestions as to whether this is the right thing.

I think if it were returning a view, we'd definitely want it like this.
You don't want a List<Integer> to look like a List<Number> and have
it break something when someone stuffs a Float in it.

But the argument could be made that returning a new List can surely be
seen as a List<Number> because it is not referenced anywhere else as
something more specific. Many of the guava methods allow a "re-typing"
like this, although I think they have admitted that it was a mistake and
newly added methods don't allow it.

In any case, I think that it's most proper to retain things as specifically
as possible. Why would you turn a List<Integer> into a List<Number>?
Why would you want to throw away the information? If you need to pass it
to a method that expects List<Number> then that method should be modified
to correctly accept List<? extends Number>.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2958 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2010-11-29 20:35:46 +00:00