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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user