Tabs -> spaces
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4742 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -28,29 +28,29 @@ package com.threerings.admin;
|
||||
public class Log
|
||||
{
|
||||
public static com.samskivert.util.Log log =
|
||||
new com.samskivert.util.Log("admin");
|
||||
new com.samskivert.util.Log("admin");
|
||||
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.debug(message);
|
||||
log.debug(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
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
|
||||
protected void createTables ()
|
||||
{
|
||||
_ctable = new Table<ConfigDatum>(
|
||||
_ctable = new Table<ConfigDatum>(
|
||||
ConfigDatum.class, "CONFIG",
|
||||
new String[] { "NODE", "OBJECT", "FIELD" }, true);
|
||||
}
|
||||
|
||||
@@ -36,24 +36,24 @@ public class Log
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
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 ()
|
||||
{
|
||||
return _buffer.remaining();
|
||||
return _buffer.remaining();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,7 +275,7 @@ public class FramedInputStream extends InputStream
|
||||
*/
|
||||
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)
|
||||
{
|
||||
// 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)) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
} else if (len == 0) {
|
||||
return;
|
||||
}
|
||||
throw new IndexOutOfBoundsException();
|
||||
} else if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
_buffer.put(b, off, len);
|
||||
@@ -96,13 +96,13 @@ public class FramingOutputStream extends OutputStream
|
||||
{
|
||||
int ocapacity = _buffer.capacity();
|
||||
int ncapacity = _buffer.position() + needed;
|
||||
if (ncapacity > ocapacity) {
|
||||
if (ncapacity > ocapacity) {
|
||||
// increase the buffer size in large increments
|
||||
ncapacity = Math.max(ocapacity << 1, ncapacity);
|
||||
ByteBuffer newbuf = ByteBuffer.allocate(ncapacity);
|
||||
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
|
||||
int count = _buffer.limit();
|
||||
_buffer.put((byte)((count >>> 24) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 16) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 8) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 0) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 16) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 8) & 0xFF));
|
||||
_buffer.put((byte)((count >>> 0) & 0xFF));
|
||||
_buffer.rewind();
|
||||
|
||||
return _buffer;
|
||||
|
||||
@@ -35,24 +35,24 @@ public class Log
|
||||
/** Convenience function. */
|
||||
public static void debug (String message)
|
||||
{
|
||||
log.fine(message);
|
||||
log.fine(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void info (String message)
|
||||
{
|
||||
log.info(message);
|
||||
log.info(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
public static void warning (String message)
|
||||
{
|
||||
log.warning(message);
|
||||
log.warning(message);
|
||||
}
|
||||
|
||||
/** Convenience function. */
|
||||
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)
|
||||
{
|
||||
int low = 0, high = _fields.length-1;
|
||||
while (low <= high) {
|
||||
int mid = (low + high) >> 1;
|
||||
Field midVal = _fields[mid];
|
||||
int cmp = midVal.getName().compareTo(name);
|
||||
if (cmp < 0) {
|
||||
low = mid + 1;
|
||||
} else if (cmp > 0) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
return midVal; // key found
|
||||
int low = 0, high = _fields.length-1;
|
||||
while (low <= high) {
|
||||
int mid = (low + high) >> 1;
|
||||
Field midVal = _fields[mid];
|
||||
int cmp = midVal.getName().compareTo(name);
|
||||
if (cmp < 0) {
|
||||
low = mid + 1;
|
||||
} else if (cmp > 0) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
return midVal; // key found
|
||||
}
|
||||
}
|
||||
return null; // key not found.
|
||||
}
|
||||
return null; // key not found.
|
||||
}
|
||||
|
||||
/** Our object id. */
|
||||
|
||||
@@ -117,7 +117,7 @@ public class NodeRepository extends JORARepository
|
||||
@Override // documentation inherited
|
||||
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;
|
||||
|
||||
@@ -546,7 +546,7 @@ public class ConnectionManager extends LoopingThread
|
||||
int ncapacity = Math.max(_outbuf.capacity() << 1, data.length);
|
||||
log.info("Expanding output buffer size [nsize=" + ncapacity + "].");
|
||||
_outbuf = ByteBuffer.allocateDirect(ncapacity);
|
||||
}
|
||||
}
|
||||
|
||||
boolean fully = true;
|
||||
try {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class RandomUtil
|
||||
@Deprecated
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user