Fixed some unused variables, unused imports, type variable hiding, tricky

generic array type handling and other niggling bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5267 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-26 20:40:20 +00:00
parent 4fab6bb71a
commit 93fb7b01f7
11 changed files with 27 additions and 39 deletions
@@ -47,16 +47,15 @@ import com.threerings.presents.dobj.SetListener;
/**
* Allows simple editing of DSets within a distributed object.
*/
public class DSetEditor extends JPanel
implements AttributeChangeListener, SetListener, ActionListener
public class DSetEditor<E extends DSet.Entry> extends JPanel
implements AttributeChangeListener, SetListener<E>, ActionListener
{
/**
* Construct a DSet editor to merely display the specified set.
*
* @param setter The object that contains the set.
* @param setName The name of the set in the object.
* @param entryClass the Class of the DSet.Entry elements contained in the
* set.
* @param entryClass the Class of the DSet.Entry elements contained in the set.
*/
public DSetEditor (DObject setter, String setName, Class entryClass)
{
@@ -68,10 +67,8 @@ public class DSetEditor extends JPanel
*
* @param setter The object that contains the set.
* @param setName The name of the set in the object.
* @param entryClass the Class of the DSet.Entry elements contained in the
* set.
* @param editableFields the names of the fields in the entryClass that
* should be editable.
* @param entryClass the Class of the DSet.Entry elements contained in the set.
* @param editableFields the names of the fields in the entryClass that should be editable.
*/
public DSetEditor (DObject setter, String setName, Class entryClass,
String[] editableFields)
@@ -84,15 +81,12 @@ public class DSetEditor extends JPanel
*
* @param setter The object that contains the set.
* @param setName The name of the set in the object.
* @param entryClass the Class of the DSet.Entry elements contained in the
* set.
* @param editableFields the names of the fields in the entryClass that
* should be editable.
* @param entryClass the Class of the DSet.Entry elements contained in the set.
* @param editableFields the names of the fields in the entryClass that should be editable.
* @param interp The FieldInterpreter to use.
*/
public DSetEditor (DObject setter, String setName, Class entryClass,
String[] editableFields,
ObjectEditorTable.FieldInterpreter interp)
String[] editableFields, ObjectEditorTable.FieldInterpreter interp)
{
super(new BorderLayout());
@@ -149,10 +143,10 @@ public class DSetEditor extends JPanel
}
// documentation inherited from interface SetListener
public void entryAdded (EntryAddedEvent event)
public void entryAdded (EntryAddedEvent<E> event)
{
if (event.getName().equals(_setName)) {
DSet.Entry entry = event.getEntry();
E entry = event.getEntry();
@SuppressWarnings("unchecked") Comparable<Object> key = entry.getKey();
int index = _keys.insertSorted(key);
_table.insertDatum(entry, index);
@@ -160,7 +154,7 @@ public class DSetEditor extends JPanel
}
// documentation inherited from interface SetListener
public void entryRemoved (EntryRemovedEvent event)
public void entryRemoved (EntryRemovedEvent<E> event)
{
if (event.getName().equals(_setName)) {
Comparable key = event.getKey();
@@ -171,10 +165,10 @@ public class DSetEditor extends JPanel
}
// documentation inherited from interface SetListener
public void entryUpdated (EntryUpdatedEvent event)
public void entryUpdated (EntryUpdatedEvent<E> event)
{
if (event.getName().equals(_setName)) {
DSet.Entry entry = event.getEntry();
E entry = event.getEntry();
int index = _keys.indexOf(entry.getKey());
_table.updateDatum(entry, index);
}
@@ -200,7 +194,7 @@ public class DSetEditor extends JPanel
protected void refreshData ()
{
_keys = new ComparableArrayList<Comparable<Object>>();
DSet.Entry[] entries = new DSet.Entry[_set.size()];
@SuppressWarnings("unchecked") E[] entries = (E[])new DSet.Entry[_set.size()];
_set.toArray(entries);
for (int ii = 0; ii < entries.length; ii++) {
@SuppressWarnings("unchecked") Comparable<Object> key = entries[ii].getKey();
@@ -216,7 +210,7 @@ public class DSetEditor extends JPanel
protected String _setName;
/** The set itself. */
protected DSet<?> _set;
protected DSet<E> _set;
/** An array we use to track our entries' positions by key. */
protected ComparableArrayList<Comparable<Object>> _keys;
@@ -827,7 +827,7 @@ public class BlockingCommunicator extends Communicator
return false; // cancelled
} else if (resp > 0) {
DownstreamMessage msg = receiveDatagram();
receiveDatagram();
return true;
}
}
@@ -439,7 +439,7 @@ public class ClientDObjectMgr
for (Iterator<IntMap.IntEntry<FlushRecord>> iter = _flushes.intEntrySet().iterator();
iter.hasNext(); ) {
IntMap.IntEntry<FlushRecord> entry = iter.next();
int oid = entry.getIntKey();
// int oid = entry.getIntKey();
FlushRecord rec = entry.getValue();
if (rec.expire <= now) {
iter.remove();
@@ -154,7 +154,7 @@ public class InvocationDirector
log.warning("Receiver unregistered for which we have no id to code mapping " +
"[code=" + receiverCode + "].");
} else {
Object decoder = _receivers.remove(rreg.receiverId);
// Object decoder = _receivers.remove(rreg.receiverId);
// Log.info("Cleared receiver " + StringUtil.shortClassName(decoder) +
// " " + rreg + ".");
}
@@ -120,7 +120,6 @@ public class DynamicListener
*/
protected Method resolveMethod (String name, Object[] arguments)
{
Class clazz = _target.getClass();
Class[] ptypes = new Class[arguments.length];
for (int ii = 0; ii < arguments.length; ii++) {
ptypes[ii] = arguments[ii] == null ?
@@ -36,7 +36,6 @@ import com.samskivert.util.Throttle;
import com.threerings.util.Name;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.data.InvocationMarshaller;
import com.threerings.presents.dobj.DEvent;
import com.threerings.presents.dobj.DObject;
@@ -21,7 +21,6 @@
package com.threerings.presents.server;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -737,7 +737,7 @@ public class ActionScriptSource
line = slurpUntil(bin, line, ";", false);
}
String fieldName = m.group(1);
// String fieldName = m.group(1);
// TODO: update the comment?
accum.setLength(0);
@@ -29,7 +29,6 @@ import java.lang.reflect.Modifier;
import java.util.ArrayList;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
@@ -51,9 +51,7 @@ public class DependencyGraph<T>
public T removeAvailableElement ()
{
T elem = _orphans.get(0);
DependencyNode<T> node = _nodes.get(elem);
remove(elem);
return elem;
}
@@ -132,17 +130,17 @@ public class DependencyGraph<T>
protected ArrayList<T> _orphans = new ArrayList<T>();
/** Represents a node in our dependency graph. */
protected class DependencyNode<T>
protected class DependencyNode<DT>
{
public T content;
public ArrayList<DependencyNode<T>> parents;
public ArrayList<DependencyNode<T>> children;
public DT content;
public ArrayList<DependencyNode<DT>> parents;
public ArrayList<DependencyNode<DT>> children;
public DependencyNode (T contents)
public DependencyNode (DT contents)
{
this.content = contents;
this.parents = new ArrayList<DependencyNode<T>>();
this.children = new ArrayList<DependencyNode<T>>();
this.parents = new ArrayList<DependencyNode<DT>>();
this.children = new ArrayList<DependencyNode<DT>>();
}
}
}
@@ -246,7 +246,7 @@ public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
{
try {
// make a deep clone of the contents
StreamableEnumSet cset = (StreamableEnumSet)super.clone();
@SuppressWarnings("unchecked") StreamableEnumSet<E> cset = (StreamableEnumSet<E>)super.clone();
cset._contents = _contents.clone();
return cset;