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:
@@ -156,7 +156,7 @@ public class ClientDObjectMgr
|
||||
*/
|
||||
public void registerFlushDelay (Class objclass, long delay)
|
||||
{
|
||||
_delays.put(objclass, new Long(delay));
|
||||
_delays.put(objclass, Long.valueOf(delay));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,7 +419,7 @@ public class ClientDObjectMgr
|
||||
* The object action is used to queue up a subscribe or unsubscribe
|
||||
* request.
|
||||
*/
|
||||
protected class ObjectAction
|
||||
protected static final class ObjectAction
|
||||
{
|
||||
public int oid;
|
||||
public Subscriber target;
|
||||
@@ -438,7 +438,7 @@ public class ClientDObjectMgr
|
||||
}
|
||||
}
|
||||
|
||||
protected static class PendingRequest
|
||||
protected static final class PendingRequest
|
||||
{
|
||||
public int oid;
|
||||
public ArrayList targets = new ArrayList();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: InvocationReceiver.java,v 1.7 2004/08/27 02:20:18 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: InvocationService.java,v 1.3 2004/08/27 02:20:18 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: TimeBaseService.java,v 1.4 2004/08/27 02:20:18 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
|
||||
@@ -50,7 +50,7 @@ public class TimeBaseMarshaller extends InvocationMarshaller
|
||||
_invId = null;
|
||||
omgr.postEvent(new InvocationResponseEvent(
|
||||
callerOid, requestId, GOT_TIME_OID,
|
||||
new Object[] { new Integer(arg1) }));
|
||||
new Object[] { Integer.valueOf(arg1) }));
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -64,6 +64,7 @@ public class TimeBaseMarshaller extends InvocationMarshaller
|
||||
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ public class TimeBaseObject extends DObject
|
||||
{
|
||||
long ovalue = this.evenBase;
|
||||
requestAttributeChange(
|
||||
EVEN_BASE, new Long(value), new Long(ovalue));
|
||||
EVEN_BASE, Long.valueOf(value), Long.valueOf(ovalue));
|
||||
this.evenBase = value;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class TimeBaseObject extends DObject
|
||||
{
|
||||
long ovalue = this.oddBase;
|
||||
requestAttributeChange(
|
||||
ODD_BASE, new Long(value), new Long(ovalue));
|
||||
ODD_BASE, Long.valueOf(value), Long.valueOf(ovalue));
|
||||
this.oddBase = value;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
@@ -125,7 +125,7 @@ public class InvocationManager
|
||||
bootlist.add(marsh);
|
||||
}
|
||||
|
||||
_recentRegServices.put(new Integer(invCode),
|
||||
_recentRegServices.put(Integer.valueOf(invCode),
|
||||
marsh.getClass().getName());
|
||||
|
||||
// Log.info("Registered service [marsh=" + marsh + "].");
|
||||
@@ -229,7 +229,7 @@ public class InvocationManager
|
||||
"registration was already cleared [code=" + invCode +
|
||||
", methId=" + methodId +
|
||||
", args=" + StringUtil.toString(args) + ", marsh=" +
|
||||
_recentRegServices.get(new Integer(invCode)) + "].");
|
||||
_recentRegServices.get(Integer.valueOf(invCode)) + "].");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ public class PresentsClient
|
||||
|
||||
// let the client know that the rug has been yanked out
|
||||
// from under their ass
|
||||
Object[] args = new Object[] { new Integer(clobj.getOid()) };
|
||||
Object[] args = new Object[] { Integer.valueOf(clobj.getOid()) };
|
||||
_clobj.postMessage(ClientObject.CLOBJ_CHANGED, args);
|
||||
|
||||
// call down to any derived classes
|
||||
|
||||
@@ -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
|
||||
@@ -63,6 +63,7 @@ public class TimeBaseDispatcher extends InvocationDispatcher
|
||||
|
||||
default:
|
||||
super.dispatchRequest(source, methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,21 +69,21 @@ public class GenUtil
|
||||
public static String boxArgument (Class clazz, String name)
|
||||
{
|
||||
if (clazz == Boolean.TYPE) {
|
||||
return "new Boolean(" + name + ")";
|
||||
return "Boolean.valueOf(" + name + ")";
|
||||
} else if (clazz == Byte.TYPE) {
|
||||
return "new Byte(" + name + ")";
|
||||
return "Byte.valueOf(" + name + ")";
|
||||
} else if (clazz == Character.TYPE) {
|
||||
return "new Character(" + name + ")";
|
||||
return "Character.valueOf(" + name + ")";
|
||||
} else if (clazz == Short.TYPE) {
|
||||
return "new Short(" + name + ")";
|
||||
return "Short.valueOf(" + name + ")";
|
||||
} else if (clazz == Integer.TYPE) {
|
||||
return "new Integer(" + name + ")";
|
||||
return "Integer.valueOf(" + name + ")";
|
||||
} else if (clazz == Long.TYPE) {
|
||||
return "new Long(" + name + ")";
|
||||
return "Long.valueOf(" + name + ")";
|
||||
} else if (clazz == Float.TYPE) {
|
||||
return "new Float(" + name + ")";
|
||||
return "Float.valueOf(" + name + ")";
|
||||
} else if (clazz == Double.TYPE) {
|
||||
return "new Double(" + name + ")";
|
||||
return "Double.valueOf(" + name + ")";
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public class ${name}Decoder extends InvocationDecoder
|
||||
#end
|
||||
default:
|
||||
super.dispatchNotification(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class ${name}Dispatcher extends InvocationDispatcher
|
||||
#end
|
||||
default:
|
||||
super.dispatchRequest(source, methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public class ${name}Marshaller extends InvocationMarshaller
|
||||
#end
|
||||
default:
|
||||
super.dispatchResponse(methodId, args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user