Tweaks to allow serializing config attributes other than DSets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6304 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -60,6 +60,9 @@ public class Streamer
|
||||
*/
|
||||
public synchronized static boolean isStreamable (Class<?> target)
|
||||
{
|
||||
// if we have not yet initialized ourselves, do so now
|
||||
maybeInit();
|
||||
|
||||
while (true) {
|
||||
// if we've got a streamer for it, it's good
|
||||
if (_streamers.containsKey(target)) {
|
||||
@@ -108,9 +111,7 @@ public class Streamer
|
||||
throws IOException
|
||||
{
|
||||
// if we have not yet initialized ourselves, do so now
|
||||
if (_streamers == null) {
|
||||
_streamers = Maps.newHashMap(BasicStreamers.BSTREAMERS);
|
||||
}
|
||||
maybeInit();
|
||||
|
||||
Streamer stream = _streamers.get(target);
|
||||
if (stream == null) {
|
||||
@@ -487,6 +488,16 @@ public class Streamer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes static state if necessary.
|
||||
*/
|
||||
protected synchronized static void maybeInit ()
|
||||
{
|
||||
if (_streamers == null) {
|
||||
_streamers = Maps.newHashMap(BasicStreamers.BSTREAMERS);
|
||||
}
|
||||
}
|
||||
|
||||
/** Used to coerce the type system into quietude when reading enums from the wire. */
|
||||
protected static enum EnumReader implements ByteEnum {
|
||||
NOT_USED;
|
||||
|
||||
Reference in New Issue
Block a user