ZOMG, Narya now perfectly passes our coding standards as enforced by

CheckStyle. The checks are slightly looser than I'd like but way better than
nothing and we get a bunch of other useful warnings like shadowed names and
other handy bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5253 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-22 14:36:54 +00:00
parent 5c4ab96880
commit 0a893e1de1
33 changed files with 159 additions and 124 deletions
@@ -77,7 +77,6 @@ public class DependencyGraph<T>
* Records a new dependency of the dependant upon the dependee.
*/
public void addDependency (T dependant, T dependee)
throws IllegalArgumentException
{
_orphans.remove(dependant);
DependencyNode<T> dependantNode = _nodes.get(dependant);
@@ -132,6 +131,7 @@ public class DependencyGraph<T>
/** Nodes in the graph with no parents/dependencies. */
protected ArrayList<T> _orphans = new ArrayList<T>();
/** Represents a node in our dependency graph. */
protected class DependencyNode<T>
{
public T content;
@@ -325,9 +325,8 @@ public class MessageBundle
}
}
return (msg != null) ?
MessageFormat.format(MessageUtil.escape(msg), args)
: (key + StringUtil.toString(args));
return (msg != null) ? MessageFormat.format(MessageUtil.escape(msg), args) :
(key + StringUtil.toString(args));
}
/**
@@ -202,8 +202,7 @@ public class MessageManager
protected ClassLoader _loader;
/** A cache of instantiated message bundles. */
protected HashMap<String,MessageBundle> _cache =
new HashMap<String,MessageBundle>();
protected HashMap<String, MessageBundle> _cache = new HashMap<String, MessageBundle>();
/** Our top-level message bundle, from which others obtain messages if
* they can't find them within themselves. */
+1 -1
View File
@@ -28,7 +28,7 @@ import java.util.Random;
/**
* Maintained for backwards compatibility with old Game Gardens games.
*
*
* @deprecated moved to {@link com.samskivert.util.RandomUtil}.
*/
@Deprecated
@@ -33,6 +33,7 @@ import com.threerings.io.Streamable;
* the list must also be of streamable types.
*
* @see Streamable
* @param <E> the type of elements stored in this list.
*/
public class StreamableArrayList<E> extends ArrayList<E>
implements Streamable
@@ -38,6 +38,7 @@ import com.threerings.io.Streamable;
* that can be streamed.
*
* @see Streamable
* @param <E> the type of enum being stored in this set.
*/
public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
implements Cloneable, Streamable
@@ -35,6 +35,7 @@ import com.threerings.io.Streamable;
* values in the map must also be of streamable types.
*
* @see Streamable
* @param <V> the type of value stored in this map.
*/
public class StreamableHashIntMap<V> extends HashIntMap<V>
implements Streamable
@@ -34,8 +34,10 @@ import com.threerings.io.Streamable;
* in the map must also be of streamable types.
*
* @see Streamable
* @param <K> the type of key stored in this map.
* @param <V> the type of value stored in this map.
*/
public class StreamableHashMap<K,V> extends HashMap<K,V>
public class StreamableHashMap<K, V> extends HashMap<K, V>
implements Streamable
{
/**
@@ -64,7 +66,7 @@ public class StreamableHashMap<K,V> extends HashMap<K,V>
{
int ecount = size();
out.writeInt(ecount);
for (Map.Entry<K,V> entry : entrySet()) {
for (Map.Entry<K, V> entry : entrySet()) {
out.writeObject(entry.getKey());
out.writeObject(entry.getValue());
}
@@ -33,6 +33,7 @@ import com.threerings.io.Streamable;
* streamable types.
*
* @see Streamable
* @param <E> the type of element stored in this set.
*/
public class StreamableHashSet<E> extends HashSet<E>
implements Streamable
@@ -25,6 +25,9 @@ import java.awt.Point;
import com.threerings.io.Streamable;
/**
* A point that can be sent over the network.
*/
public class StreamablePoint extends Point
implements Streamable
{
@@ -30,6 +30,8 @@ import com.threerings.io.Streamable;
* must also be of streamable types.
*
* @see Streamable
* @param <L> the type of the left-hand side of this tuple.
* @param <R> the type of the right-hand side of this tuple.
*/
public class StreamableTuple<L, R> extends Tuple<L, R>
implements Streamable
@@ -90,7 +90,7 @@ public class TrackedObject
* instances and an <code>int[]</code> array that represent the number
* of outstanding instance of all {@link TrackedObject}s in the VM.
*/
public static Tuple<Class[],int[]> getSnapshot ()
public static Tuple<Class[], int[]> getSnapshot ()
{
Class[] classes = null;
int[] counts = null;
@@ -98,15 +98,15 @@ public class TrackedObject
classes = new Class[_map.size()];
counts = new int[_map.size()];
int idx = 0;
for (Map.Entry<Class,int[]> entry : _map.entrySet()) {
for (Map.Entry<Class, int[]> entry : _map.entrySet()) {
classes[idx] = entry.getKey();
counts[idx] = entry.getValue()[0];
idx++;
}
}
return new Tuple<Class[],int[]>(classes, counts);
return new Tuple<Class[], int[]>(classes, counts);
}
/** Tracks a mapping from {@link Class} object to active count. */
protected static HashMap<Class,int[]> _map = new HashMap<Class,int[]>();
protected static HashMap<Class, int[]> _map = new HashMap<Class, int[]>();
}