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
@@ -1,5 +1,5 @@
//
// $Id: SpeakService.java,v 1.3 2004/08/27 02:12:30 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
@@ -52,7 +52,7 @@ public class ChatMarshaller extends InvocationMarshaller
_invId = null;
omgr.postEvent(new InvocationResponseEvent(
callerOid, requestId, TELL_SUCCEEDED,
new Object[] { new Long(arg1), arg2 }));
new Object[] { Long.valueOf(arg1), arg2 }));
}
// documentation inherited
@@ -66,6 +66,7 @@ public class ChatMarshaller extends InvocationMarshaller
default:
super.dispatchResponse(methodId, args);
return;
}
}
}
@@ -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
@@ -43,7 +43,7 @@ public class SpeakMarshaller extends InvocationMarshaller
public void speak (Client arg1, String arg2, byte arg3)
{
sendRequest(arg1, SPEAK, new Object[] {
arg2, new Byte(arg3)
arg2, Byte.valueOf(arg3)
});
}
@@ -1,5 +1,5 @@
//
// $Id: SpeakObject.java,v 1.4 2004/08/27 02:12:31 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
@@ -80,6 +80,7 @@ public class ChatDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -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
@@ -64,6 +64,7 @@ public class SpeakDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -1,5 +1,5 @@
//
// $Id: BodyService.java,v 1.2 2004/08/27 02:12:32 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -63,6 +63,7 @@ public class LocationDecoder extends InvocationDecoder
default:
super.dispatchNotification(methodId, args);
return;
}
}
}
@@ -1,5 +1,5 @@
//
// $Id: LocationReceiver.java,v 1.2 2004/08/27 02:12:33 mdb Exp $
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
@@ -98,7 +98,7 @@ public class OccupantDirector extends BasicDirector
{
// make sure we're somewhere
return (_place == null) ? null :
(OccupantInfo)_place.occupantInfo.get(new Integer(bodyOid));
(OccupantInfo)_place.occupantInfo.get(Integer.valueOf(bodyOid));
}
/**
@@ -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
@@ -43,7 +43,7 @@ public class BodyMarshaller extends InvocationMarshaller
public void setIdle (Client arg1, boolean arg2)
{
sendRequest(arg1, SET_IDLE, new Object[] {
new Boolean(arg2)
Boolean.valueOf(arg2)
});
}
@@ -175,7 +175,7 @@ public class BodyObject extends ClientObject
{
int ovalue = this.location;
requestAttributeChange(
LOCATION, new Integer(value), new Integer(ovalue));
LOCATION, Integer.valueOf(value), Integer.valueOf(ovalue));
this.location = value;
}
@@ -191,7 +191,7 @@ public class BodyObject extends ClientObject
{
byte ovalue = this.status;
requestAttributeChange(
STATUS, new Byte(value), new Byte(ovalue));
STATUS, Byte.valueOf(value), Byte.valueOf(ovalue));
this.status = value;
}
@@ -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
@@ -65,6 +65,7 @@ public class LocationMarshaller extends InvocationMarshaller
default:
super.dispatchResponse(methodId, args);
return;
}
}
}
@@ -89,7 +90,7 @@ public class LocationMarshaller extends InvocationMarshaller
LocationMarshaller.MoveMarshaller listener3 = new LocationMarshaller.MoveMarshaller();
listener3.listener = arg3;
sendRequest(arg1, MOVE_TO, new Object[] {
new Integer(arg2), listener3
Integer.valueOf(arg2), listener3
});
}
@@ -74,7 +74,7 @@ public class OccupantInfo extends SimpleStreamableObject
*/
public OccupantInfo (BodyObject body)
{
bodyOid = new Integer(body.getOid());
bodyOid = Integer.valueOf(body.getOid());
username = body.getVisibleName();
status = body.status;
}
@@ -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
@@ -64,6 +64,7 @@ public class BodyDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -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
@@ -71,6 +71,7 @@ public class LocationDispatcher extends InvocationDispatcher
default:
super.dispatchRequest(source, methodId, args);
return;
}
}
}
@@ -194,7 +194,7 @@ public class LocationProvider
try {
PlaceObject pold = (PlaceObject)_omgr.getObject(oldloc);
if (pold != null) {
Integer key = new Integer(bodoid);
Integer key = Integer.valueOf(bodoid);
pold.startTransaction();
try {
// remove their occupant info (which is keyed on oid)
@@ -41,7 +41,7 @@ public class LocationSender extends InvocationSender
{
sendNotification(
target, LocationDecoder.RECEIVER_CODE, LocationDecoder.FORCED_MOVE,
new Object[] { new Integer(arg1) });
new Object[] { Integer.valueOf(arg1) });
}
}
@@ -446,7 +446,7 @@ public class PlaceManager
// if their occupant info hasn't been removed (which may be the
// case if they logged off rather than left via a MoveTo request),
// we need to get it on out of here
Integer key = new Integer(bodyOid);
Integer key = Integer.valueOf(bodyOid);
if (_plobj.occupantInfo.containsKey(key)) {
_plobj.removeFromOccupantInfo(key);
}