Pass in the expected type to readObject anywhere the code would clearly convert the wrong type to null anyway

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5440 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-10-11 06:28:50 +00:00
parent a3cc67348e
commit 2b298aa3d5
18 changed files with 22 additions and 22 deletions
@@ -78,7 +78,7 @@ public class UserMessage extends ChatMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
speaker = (ins.readObject() as Name); speaker = (ins.readObject(Name) as Name);
mode = ins.readByte(); mode = ins.readByte();
} }
@@ -51,7 +51,7 @@ public class UserSystemMessage extends SystemMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
speaker = (ins.readObject() as Name); speaker = (ins.readObject(Name) as Name);
} }
// from interface Streamable // from interface Streamable
@@ -180,7 +180,7 @@ public class BodyObject extends ClientObject
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
location = (ins.readObject() as Place); location = (ins.readObject(Place) as Place);
status = ins.readByte(); status = ins.readByte();
awayMessage = (ins.readField(String) as String); awayMessage = (ins.readField(String) as String);
} }
@@ -118,7 +118,7 @@ public class OccupantInfo extends SimpleStreamableObject
{ {
super.readObject(ins); super.readObject(ins);
bodyOid = (ins.readField(Integer) as Integer).value; bodyOid = (ins.readField(Integer) as Integer).value;
username = (ins.readObject() as Name); username = (ins.readObject(Name) as Name);
status = ins.readByte(); status = ins.readByte();
} }
@@ -206,9 +206,9 @@ public class PlaceObject extends DObject
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
occupants = (ins.readObject() as OidList); occupants = (ins.readObject(OidList) as OidList);
occupantInfo = (ins.readObject() as DSet); occupantInfo = (ins.readObject(DSet) as DSet);
speakService = (ins.readObject() as SpeakMarshaller); speakService = (ins.readObject(SpeakMarshaller) as SpeakMarshaller);
} }
} }
} }
@@ -51,7 +51,7 @@ public class CrowdClientInfo extends ClientInfo
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
visibleName = (ins.readObject() as Name); visibleName = (ins.readObject(Name) as Name);
} }
// from interface Streamable // from interface Streamable
@@ -236,7 +236,7 @@ public class Communicator
_inStream.setSource(frameData); _inStream.setSource(frameData);
var msg :DownstreamMessage; var msg :DownstreamMessage;
try { try {
msg = (_inStream.readObject() as DownstreamMessage); msg = (_inStream.readObject(DownstreamMessage) as DownstreamMessage);
} catch (e :Error) { } catch (e :Error) {
log.warning("Error processing downstream message: " + e); log.warning("Error processing downstream message: " + e);
log.logStackTrace(e); log.logStackTrace(e);
@@ -108,9 +108,9 @@ public class ClientObject extends DObject
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
username = (ins.readObject() as Name); username = (ins.readObject(Name) as Name);
receivers = (ins.readObject() as DSet); receivers = (ins.readObject(DSet) as DSet);
_permPolicy = (ins.readObject() as PermissionPolicy); _permPolicy = (ins.readObject(PermissionPolicy) as PermissionPolicy);
} }
protected var _permPolicy :PermissionPolicy; protected var _permPolicy :PermissionPolicy;
@@ -112,7 +112,7 @@ public class CompoundEvent extends DEvent
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_events = (ins.readObject() as StreamableArrayList); _events = (ins.readObject(StreamableArrayList) as StreamableArrayList);
} }
/** A list of the events associated with this compound event. */ /** A list of the events associated with this compound event. */
@@ -104,7 +104,7 @@ public class EntryAddedEvent extends NamedEvent
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_entry = (ins.readObject() as DSet_Entry); _entry = (ins.readObject(DSet_Entry) as DSet_Entry);
} }
protected var _entry :DSet_Entry; protected var _entry :DSet_Entry;
@@ -122,7 +122,7 @@ public class EntryUpdatedEvent extends NamedEvent
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_entry = (ins.readObject() as DSet_Entry); _entry = (ins.readObject(DSet_Entry) as DSet_Entry);
} }
protected var _entry :DSet_Entry; protected var _entry :DSet_Entry;
@@ -34,7 +34,7 @@ public class AuthResponse extends DownstreamMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_data = (ins.readObject() as AuthResponseData); _data = (ins.readObject(AuthResponseData) as AuthResponseData);
} }
protected var _data :AuthResponseData; protected var _data :AuthResponseData;
@@ -55,7 +55,7 @@ public class BootstrapData
{ {
connectionId = ins.readInt(); connectionId = ins.readInt();
clientOid = ins.readInt(); clientOid = ins.readInt();
services = (ins.readObject() as Array); services = (ins.readObject(Array) as Array);
} }
} }
} }
@@ -33,7 +33,7 @@ public class BootstrapNotification extends DownstreamMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_data = (ins.readObject() as BootstrapData); _data = (ins.readObject(BootstrapData) as BootstrapData);
} }
/** The data associated with this notification. */ /** The data associated with this notification. */
@@ -57,7 +57,7 @@ public /* abstract */ class Credentials
public function readObject (ins :ObjectInputStream) :void public function readObject (ins :ObjectInputStream) :void
//throws IOError //throws IOError
{ {
_username = (ins.readObject() as Name); _username = (ins.readObject(Name) as Name);
} }
public function toString () :String public function toString () :String
@@ -40,7 +40,7 @@ public class EventNotification extends DownstreamMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_event = (ins.readObject() as DEvent); _event = (ins.readObject(DEvent) as DEvent);
} }
/** The event which we are forwarding. */ /** The event which we are forwarding. */
@@ -40,7 +40,7 @@ public class ObjectResponse extends DownstreamMessage
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
_dobj = (ins.readObject() as DObject); _dobj = (ins.readObject(DObject) as DObject);
} }
/** The object which is associated with this response. */ /** The object which is associated with this response. */
@@ -53,7 +53,7 @@ public class ClientInfo extends SimpleStreamableObject
override public function readObject (ins :ObjectInputStream) :void override public function readObject (ins :ObjectInputStream) :void
{ {
super.readObject(ins); super.readObject(ins);
username = (ins.readObject() as Name); username = (ins.readObject(Name) as Name);
} }
// from interface Streamable // from interface Streamable