Tabs -> spaces

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4742 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Dave Hoover
2007-06-26 00:07:36 +00:00
parent 8aadcfe757
commit 3b701ef57d
10 changed files with 55 additions and 55 deletions
+5 -5
View File
@@ -28,29 +28,29 @@ package com.threerings.admin;
public class Log public class Log
{ {
public static com.samskivert.util.Log log = public static com.samskivert.util.Log log =
new com.samskivert.util.Log("admin"); new com.samskivert.util.Log("admin");
/** Convenience function. */ /** Convenience function. */
public static void debug (String message) public static void debug (String message)
{ {
log.debug(message); log.debug(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void info (String message) public static void info (String message)
{ {
log.info(message); log.info(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void warning (String message) public static void warning (String message)
{ {
log.warning(message); log.warning(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void logStackTrace (Throwable t) public static void logStackTrace (Throwable t)
{ {
log.logStackTrace(com.samskivert.util.Log.WARNING, t); log.logStackTrace(com.samskivert.util.Log.WARNING, t);
} }
} }
@@ -117,7 +117,7 @@ public class ConfigRepository extends JORARepository
// documentation inherited // documentation inherited
protected void createTables () protected void createTables ()
{ {
_ctable = new Table<ConfigDatum>( _ctable = new Table<ConfigDatum>(
ConfigDatum.class, "CONFIG", ConfigDatum.class, "CONFIG",
new String[] { "NODE", "OBJECT", "FIELD" }, true); new String[] { "NODE", "OBJECT", "FIELD" }, true);
} }
+4 -4
View File
@@ -36,24 +36,24 @@ public class Log
/** Convenience function. */ /** Convenience function. */
public static void debug (String message) public static void debug (String message)
{ {
log.fine(message); log.fine(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void info (String message) public static void info (String message)
{ {
log.info(message); log.info(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void warning (String message) public static void warning (String message)
{ {
log.warning(message); log.warning(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void logStackTrace (Throwable t) public static void logStackTrace (Throwable t)
{ {
log.log(Level.WARNING, t.getMessage(), t); log.log(Level.WARNING, t.getMessage(), t);
} }
} }
@@ -266,7 +266,7 @@ public class FramedInputStream extends InputStream
*/ */
public int available () public int available ()
{ {
return _buffer.remaining(); return _buffer.remaining();
} }
/** /**
@@ -275,7 +275,7 @@ public class FramedInputStream extends InputStream
*/ */
public boolean markSupported () public boolean markSupported ()
{ {
return false; return false;
} }
/** /**
@@ -74,12 +74,12 @@ public class FramingOutputStream extends OutputStream
public void write (byte[] b, int off, int len) public void write (byte[] b, int off, int len)
{ {
// sanity check the arguments // sanity check the arguments
if ((off < 0) || (off > b.length) || (len < 0) || if ((off < 0) || (off > b.length) || (len < 0) ||
((off + len) > b.length) || ((off + len) < 0)) { ((off + len) > b.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException(); throw new IndexOutOfBoundsException();
} else if (len == 0) { } else if (len == 0) {
return; return;
} }
try { try {
_buffer.put(b, off, len); _buffer.put(b, off, len);
@@ -96,13 +96,13 @@ public class FramingOutputStream extends OutputStream
{ {
int ocapacity = _buffer.capacity(); int ocapacity = _buffer.capacity();
int ncapacity = _buffer.position() + needed; int ncapacity = _buffer.position() + needed;
if (ncapacity > ocapacity) { if (ncapacity > ocapacity) {
// increase the buffer size in large increments // increase the buffer size in large increments
ncapacity = Math.max(ocapacity << 1, ncapacity); ncapacity = Math.max(ocapacity << 1, ncapacity);
ByteBuffer newbuf = ByteBuffer.allocate(ncapacity); ByteBuffer newbuf = ByteBuffer.allocate(ncapacity);
newbuf.put((ByteBuffer)_buffer.flip()); newbuf.put((ByteBuffer)_buffer.flip());
_buffer = newbuf; _buffer = newbuf;
} }
} }
/** /**
@@ -119,9 +119,9 @@ public class FramingOutputStream extends OutputStream
// buffer so that all the data is available // buffer so that all the data is available
int count = _buffer.limit(); int count = _buffer.limit();
_buffer.put((byte)((count >>> 24) & 0xFF)); _buffer.put((byte)((count >>> 24) & 0xFF));
_buffer.put((byte)((count >>> 16) & 0xFF)); _buffer.put((byte)((count >>> 16) & 0xFF));
_buffer.put((byte)((count >>> 8) & 0xFF)); _buffer.put((byte)((count >>> 8) & 0xFF));
_buffer.put((byte)((count >>> 0) & 0xFF)); _buffer.put((byte)((count >>> 0) & 0xFF));
_buffer.rewind(); _buffer.rewind();
return _buffer; return _buffer;
+4 -4
View File
@@ -35,24 +35,24 @@ public class Log
/** Convenience function. */ /** Convenience function. */
public static void debug (String message) public static void debug (String message)
{ {
log.fine(message); log.fine(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void info (String message) public static void info (String message)
{ {
log.info(message); log.info(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void warning (String message) public static void warning (String message)
{ {
log.warning(message); log.warning(message);
} }
/** Convenience function. */ /** Convenience function. */
public static void logStackTrace (Throwable t) public static void logStackTrace (Throwable t)
{ {
log.log(Level.WARNING, t.getMessage(), t); log.log(Level.WARNING, t.getMessage(), t);
} }
} }
@@ -830,20 +830,20 @@ public class DObject
*/ */
protected final Field getField (String name) protected final Field getField (String name)
{ {
int low = 0, high = _fields.length-1; int low = 0, high = _fields.length-1;
while (low <= high) { while (low <= high) {
int mid = (low + high) >> 1; int mid = (low + high) >> 1;
Field midVal = _fields[mid]; Field midVal = _fields[mid];
int cmp = midVal.getName().compareTo(name); int cmp = midVal.getName().compareTo(name);
if (cmp < 0) { if (cmp < 0) {
low = mid + 1; low = mid + 1;
} else if (cmp > 0) { } else if (cmp > 0) {
high = mid - 1; high = mid - 1;
} else { } else {
return midVal; // key found return midVal; // key found
} }
} }
return null; // key not found. return null; // key not found.
} }
/** Our object id. */ /** Our object id. */
@@ -117,7 +117,7 @@ public class NodeRepository extends JORARepository
@Override // documentation inherited @Override // documentation inherited
protected void createTables () protected void createTables ()
{ {
_ntable = new Table<NodeRecord>(NodeRecord.class, "NODES", "NODE_NAME", true); _ntable = new Table<NodeRecord>(NodeRecord.class, "NODES", "NODE_NAME", true);
} }
protected Table<NodeRecord> _ntable; protected Table<NodeRecord> _ntable;
@@ -546,7 +546,7 @@ public class ConnectionManager extends LoopingThread
int ncapacity = Math.max(_outbuf.capacity() << 1, data.length); int ncapacity = Math.max(_outbuf.capacity() << 1, data.length);
log.info("Expanding output buffer size [nsize=" + ncapacity + "]."); log.info("Expanding output buffer size [nsize=" + ncapacity + "].");
_outbuf = ByteBuffer.allocateDirect(ncapacity); _outbuf = ByteBuffer.allocateDirect(ncapacity);
} }
boolean fully = true; boolean fully = true;
try { try {
+13 -13
View File
@@ -40,7 +40,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static int getInt (int high) public static int getInt (int high)
{ {
return com.samskivert.util.RandomUtil.getInt(high); return com.samskivert.util.RandomUtil.getInt(high);
} }
/** /**
@@ -49,7 +49,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static int getInt (int high, int low) public static int getInt (int high, int low)
{ {
return com.samskivert.util.RandomUtil.getInt(high, low); return com.samskivert.util.RandomUtil.getInt(high, low);
} }
/** /**
@@ -58,7 +58,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static float getFloat (float high) public static float getFloat (float high)
{ {
return com.samskivert.util.RandomUtil.getFloat(high); return com.samskivert.util.RandomUtil.getFloat(high);
} }
/** /**
@@ -67,7 +67,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static int getWeightedIndex (int[] weights) public static int getWeightedIndex (int[] weights)
{ {
return com.samskivert.util.RandomUtil.getWeightedIndex(weights); return com.samskivert.util.RandomUtil.getWeightedIndex(weights);
} }
/** /**
@@ -76,7 +76,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static int getWeightedIndex (float[] weights) public static int getWeightedIndex (float[] weights)
{ {
return com.samskivert.util.RandomUtil.getWeightedIndex(weights); return com.samskivert.util.RandomUtil.getWeightedIndex(weights);
} }
/** /**
@@ -85,7 +85,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (T[] values) public static <T> T pickRandom (T[] values)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values); return com.samskivert.util.RandomUtil.pickRandom(values);
} }
/** /**
@@ -94,7 +94,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (T[] values, T skip) public static <T> T pickRandom (T[] values, T skip)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values, skip); return com.samskivert.util.RandomUtil.pickRandom(values, skip);
} }
/** /**
@@ -103,7 +103,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (Collection<T> values) public static <T> T pickRandom (Collection<T> values)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values); return com.samskivert.util.RandomUtil.pickRandom(values);
} }
/** /**
@@ -112,7 +112,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (List<T> values) public static <T> T pickRandom (List<T> values)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values); return com.samskivert.util.RandomUtil.pickRandom(values);
} }
/** /**
@@ -121,7 +121,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (List<T> values, T skip) public static <T> T pickRandom (List<T> values, T skip)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values, skip); return com.samskivert.util.RandomUtil.pickRandom(values, skip);
} }
/** /**
@@ -130,7 +130,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (List<T> values, T skip, Random r) public static <T> T pickRandom (List<T> values, T skip, Random r)
{ {
return com.samskivert.util.RandomUtil.pickRandom(values, skip, r); return com.samskivert.util.RandomUtil.pickRandom(values, skip, r);
} }
/** /**
@@ -139,7 +139,7 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (Iterator<T> iter, int count) public static <T> T pickRandom (Iterator<T> iter, int count)
{ {
return com.samskivert.util.RandomUtil.pickRandom(iter, count); return com.samskivert.util.RandomUtil.pickRandom(iter, count);
} }
/** /**
@@ -148,6 +148,6 @@ public class RandomUtil
@Deprecated @Deprecated
public static <T> T pickRandom (Iterator<T> iter, int count, T skip) public static <T> T pickRandom (Iterator<T> iter, int count, T skip)
{ {
return com.samskivert.util.RandomUtil.pickRandom(iter, count, skip); return com.samskivert.util.RandomUtil.pickRandom(iter, count, skip);
} }
} }