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:
@@ -81,7 +81,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Boolean(in.readBoolean());
|
||||
return Boolean.valueOf(in.readBoolean());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -108,7 +108,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Byte(in.readByte());
|
||||
return Byte.valueOf(in.readByte());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -135,7 +135,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Short(in.readShort());
|
||||
return Short.valueOf(in.readShort());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -162,7 +162,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Character(in.readChar());
|
||||
return Character.valueOf(in.readChar());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -189,7 +189,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Integer(in.readInt());
|
||||
return Integer.valueOf(in.readInt());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -216,7 +216,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Long(in.readLong());
|
||||
return Long.valueOf(in.readLong());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -243,7 +243,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Float(in.readFloat());
|
||||
return Float.valueOf(in.readFloat());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
@@ -270,7 +270,7 @@ public class BasicStreamers
|
||||
public Object createObject (ObjectInputStream in)
|
||||
throws IOException
|
||||
{
|
||||
return new Double(in.readDouble());
|
||||
return Double.valueOf(in.readDouble());
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SimpleStreamableObject.java,v 1.2 2004/08/27 02:12:36 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: TrackedStreamableObject.java,v 1.2 2004/08/27 02:12:36 mdb Exp $
|
||||
// $Id$
|
||||
//
|
||||
// Narya library - tools for developing networked games
|
||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||
|
||||
Reference in New Issue
Block a user