Detect programmer error in delegate usage as early as possible and fail.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5223 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-10 13:19:21 +00:00
parent 5baacc36da
commit 950fb6c4aa
2 changed files with 18 additions and 0 deletions
@@ -198,6 +198,7 @@ public class PlaceManager
*/
public void addDelegate (PlaceManagerDelegate delegate)
{
ratifyDelegate(delegate);
if (_delegates == null) {
_delegates = Lists.newArrayList();
}
@@ -675,6 +676,14 @@ public class PlaceManager
return 5 * 60 * 1000L;
}
/**
* Protects against programmer error.
*/
protected void ratifyDelegate (PlaceManagerDelegate delegate)
{
// nothing to do here, all PlaceManagerDelegates are safe for us
}
/**
* An extensible way to add to the string representation of this class. Override this (being
* sure to call super) and append your info to the buffer.