Use the valueOf factory methods pretty much everywhere.

These are the preferred way to get instances of Boolean, Byte,
Short, Character, Integer, Long, Float, and Double object.
It's always made sense for Boolean objects, and with 1.5 these factory
methods were blessed as the proper way to get instances unless one
absolutely needed a distinct object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4145 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-05-24 01:24:24 +00:00
parent c143e93554
commit 26c928fc45
100 changed files with 196 additions and 162 deletions
@@ -63,6 +63,7 @@ public class SceneDecoder extends InvocationDecoder
default:
super.dispatchNotification(methodId, args);
return;
}
}
}
@@ -341,7 +341,7 @@ public class SceneDirector extends BasicDirector
}
// update our scene cache
_scache.put(new Integer(model.sceneId), model);
_scache.put(Integer.valueOf(model.sceneId), model);
// and pass through to the normal move succeeded handler
moveSucceeded(placeId, config);
@@ -446,7 +446,7 @@ public class SceneDirector extends BasicDirector
protected SceneModel loadSceneModel (int sceneId)
{
// first look in the model cache
Integer key = new Integer(sceneId);
Integer key = Integer.valueOf(sceneId);
SceneModel model = (SceneModel)_scache.get(key);
// load from the repository if it's not cached
@@ -1,5 +1,5 @@
//
// $Id: SceneReceiver.java,v 1.2 2004/08/27 02:20:40 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -1,5 +1,5 @@
//
// $Id: SceneService.java,v 1.11 2004/08/27 02:20:40 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@ public class SceneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED,
new Object[] { new Integer(arg1), arg2 }));
new Object[] { Integer.valueOf(arg1), arg2 }));
}
/** The method id used to dispatch {@link #moveSucceededWithScene}
@@ -66,7 +66,7 @@ public class SceneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED_WITH_SCENE,
new Object[] { new Integer(arg1), arg2, arg3 }));
new Object[] { Integer.valueOf(arg1), arg2, arg3 }));
}
/** The method id used to dispatch {@link #moveSucceededWithUpdates}
@@ -79,7 +79,7 @@ public class SceneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED_WITH_UPDATES,
new Object[] { new Integer(arg1), arg2, arg3 }));
new Object[] { Integer.valueOf(arg1), arg2, arg3 }));
}
// documentation inherited
@@ -103,6 +103,7 @@ public class SceneMarshaller extends InvocationMarshaller
default:
super.dispatchResponse(methodId, args);
return;
}
}
}
@@ -116,7 +117,7 @@ public class SceneMarshaller extends InvocationMarshaller
SceneMarshaller.SceneMoveMarshaller listener4 = new SceneMarshaller.SceneMoveMarshaller();
listener4.listener = arg4;
sendRequest(arg1, MOVE_TO, new Object[] {
new Integer(arg2), new Integer(arg3), listener4
Integer.valueOf(arg2), Integer.valueOf(arg3), listener4
});
}
@@ -1,5 +1,5 @@
//
// $Id: ScenedBodyObject.java,v 1.2 2004/08/27 02:20:42 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -67,6 +67,7 @@ public class SceneDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -41,7 +41,7 @@ public class SceneSender extends InvocationSender
{
sendNotification(
target, SceneDecoder.RECEIVER_CODE, SceneDecoder.FORCED_MOVE,
new Object[] { new Integer(arg1) });
new Object[] { Integer.valueOf(arg1) });
}
}
@@ -43,7 +43,7 @@ public class Cluster extends Rectangle
public Comparable getKey ()
{
if (_key == null) {
_key = new Integer(clusterOid);
_key = Integer.valueOf(clusterOid);
}
return _key;
}
@@ -58,7 +58,7 @@ public class SceneLocation extends SimpleStreamableObject
public Comparable getKey ()
{
if (_key == null) {
_key = new Integer(bodyOid);
_key = Integer.valueOf(bodyOid);
}
return _key;
}
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@ public class SpotMarshaller extends InvocationMarshaller
InvocationMarshaller.ConfirmMarshaller listener4 = new InvocationMarshaller.ConfirmMarshaller();
listener4.listener = arg4;
sendRequest(arg1, CHANGE_LOCATION, new Object[] {
new Integer(arg2), arg3, listener4
Integer.valueOf(arg2), arg3, listener4
});
}
@@ -60,7 +60,7 @@ public class SpotMarshaller extends InvocationMarshaller
public void clusterSpeak (Client arg1, String arg2, byte arg3)
{
sendRequest(arg1, CLUSTER_SPEAK, new Object[] {
arg2, new Byte(arg3)
arg2, Byte.valueOf(arg3)
});
}
@@ -73,7 +73,7 @@ public class SpotMarshaller extends InvocationMarshaller
InvocationMarshaller.ConfirmMarshaller listener3 = new InvocationMarshaller.ConfirmMarshaller();
listener3.listener = arg3;
sendRequest(arg1, JOIN_CLUSTER, new Object[] {
new Integer(arg2), listener3
Integer.valueOf(arg2), listener3
});
}
@@ -86,7 +86,7 @@ public class SpotMarshaller extends InvocationMarshaller
SceneMarshaller.SceneMoveMarshaller listener5 = new SceneMarshaller.SceneMoveMarshaller();
listener5.listener = arg5;
sendRequest(arg1, TRAVERSE_PORTAL, new Object[] {
new Integer(arg2), new Integer(arg3), new Integer(arg4), listener5
Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5
});
}
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -89,6 +89,7 @@ public class SpotDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -154,7 +154,7 @@ public class SpotSceneManager extends SceneManager
super.bodyLeft(bodyOid);
// clear out their location information
_ssobj.removeFromOccupantLocs(new Integer(bodyOid));
_ssobj.removeFromOccupantLocs(Integer.valueOf(bodyOid));
// clear any cluster they may occupy
removeFromCluster(bodyOid);
@@ -413,7 +413,7 @@ public class SpotSceneManager extends SceneManager
*/
protected SceneLocation locationForBody (int bodyOid)
{
return (SceneLocation)_ssobj.occupantLocs.get(new Integer(bodyOid));
return (SceneLocation)_ssobj.occupantLocs.get(Integer.valueOf(bodyOid));
}
/**
@@ -63,6 +63,7 @@ public class ZoneDecoder extends InvocationDecoder
default:
super.dispatchNotification(methodId, args);
return;
}
}
}
@@ -135,7 +135,7 @@ public class ZoneDirector extends BasicDirector
// let our zone observers know that we're attempting to switch
// zones
notifyObservers(new Integer(zoneId));
notifyObservers(Integer.valueOf(zoneId));
// check the version of our cached copy of the scene to which
// we're requesting to move; if we were unable to load it, assume
@@ -1,5 +1,5 @@
//
// $Id: ZoneReceiver.java,v 1.2 2004/08/27 02:20:50 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -1,5 +1,5 @@
//
// $Id: ZoneService.java,v 1.8 2004/08/27 02:20:50 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -54,7 +54,7 @@ public class ZoneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED,
new Object[] { new Integer(arg1), arg2, arg3 }));
new Object[] { Integer.valueOf(arg1), arg2, arg3 }));
}
/** The method id used to dispatch {@link #moveSucceededWithScene}
@@ -67,7 +67,7 @@ public class ZoneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED_WITH_SCENE,
new Object[] { new Integer(arg1), arg2, arg3, arg4 }));
new Object[] { Integer.valueOf(arg1), arg2, arg3, arg4 }));
}
/** The method id used to dispatch {@link #moveSucceededWithUpdates}
@@ -80,7 +80,7 @@ public class ZoneMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, MOVE_SUCCEEDED_WITH_UPDATES,
new Object[] { new Integer(arg1), arg2, arg3, arg4 }));
new Object[] { Integer.valueOf(arg1), arg2, arg3, arg4 }));
}
// documentation inherited
@@ -104,6 +104,7 @@ public class ZoneMarshaller extends InvocationMarshaller
default:
super.dispatchResponse(methodId, args);
return;
}
}
}
@@ -117,7 +118,7 @@ public class ZoneMarshaller extends InvocationMarshaller
ZoneMarshaller.ZoneMoveMarshaller listener5 = new ZoneMarshaller.ZoneMoveMarshaller();
listener5.listener = arg5;
sendRequest(arg1, MOVE_TO, new Object[] {
new Integer(arg2), new Integer(arg3), new Integer(arg4), listener5
Integer.valueOf(arg2), Integer.valueOf(arg3), Integer.valueOf(arg4), listener5
});
}
@@ -1,5 +1,5 @@
//
// $Id: ZonedBodyObject.java,v 1.3 2004/08/27 02:20:51 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -2,7 +2,7 @@
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2005 Three Rings Design, Inc., All Rights Reserved
// Copyright (C) 2002-2006 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
@@ -68,6 +68,7 @@ public class ZoneDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -41,7 +41,7 @@ public class ZoneSender extends InvocationSender
{
sendNotification(
target, ZoneDecoder.RECEIVER_CODE, ZoneDecoder.FORCED_MOVE,
new Object[] { new Integer(arg1), new Integer(arg2) });
new Object[] { Integer.valueOf(arg1), Integer.valueOf(arg2) });
}
}