Fixed a bunch of type safety bits pointed out by the latest version of Eclipse.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5274 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-30 12:58:51 +00:00
parent ca4c5897fb
commit 725f656197
77 changed files with 248 additions and 250 deletions
@@ -57,7 +57,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
* @param setName The name of the set in the object.
* @param entryClass the Class of the DSet.Entry elements contained in the set.
*/
public DSetEditor (DObject setter, String setName, Class entryClass)
public DSetEditor (DObject setter, String setName, Class<?> entryClass)
{
this(setter, setName, entryClass, null);
}
@@ -70,7 +70,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
* @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,
public DSetEditor (DObject setter, String setName, Class<?> entryClass,
String[] editableFields)
{
this(setter, setName, entryClass, editableFields, null);
@@ -85,7 +85,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
* @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,
public DSetEditor (DObject setter, String setName, Class<?> entryClass,
String[] editableFields, ObjectEditorTable.FieldInterpreter interp)
{
super(new BorderLayout());
@@ -147,8 +147,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
{
if (event.getName().equals(_setName)) {
E entry = event.getEntry();
@SuppressWarnings("unchecked") Comparable<Object> key = entry.getKey();
int index = _keys.insertSorted(key);
int index = _keys.insertSorted(getKey(entry));
_table.insertDatum(entry, index);
}
}
@@ -157,7 +156,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
public void entryRemoved (EntryRemovedEvent<E> event)
{
if (event.getName().equals(_setName)) {
Comparable key = event.getKey();
Comparable<?> key = event.getKey();
int index = _keys.indexOf(key);
_keys.remove(index);
_table.removeDatum(index);
@@ -197,12 +196,17 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
@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();
_keys.insertSorted(key);
_keys.insertSorted(getKey(entries[ii]));
}
_table.setData(entries); // this works because DSet itself is sorted
}
@SuppressWarnings("unchecked")
protected static Comparable<Object> getKey (DSet.Entry entry)
{
return (Comparable<Object>)entry.getKey();
}
/** The object that contains the set we're displaying. */
protected DObject _setter;
@@ -47,7 +47,6 @@ public class AdminDispatcher extends InvocationDispatcher<AdminMarshaller>
return new AdminMarshaller();
}
@SuppressWarnings("unchecked")
@Override // documentation inherited
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)
@@ -67,7 +67,6 @@ import static com.threerings.admin.Log.log;
*/
public abstract class ConfigRegistry
{
/**
* Creates a ConfigRegistry that isn't transitioning.
*/
@@ -138,7 +137,7 @@ public abstract class ConfigRegistry
* Contains all necessary info for a configuration object registration.
*/
protected abstract class ObjectRecord
implements AttributeChangeListener, SetListener, ElementUpdateListener
implements AttributeChangeListener, SetListener<DSet.Entry>, ElementUpdateListener
{
public DObject object;
@@ -150,7 +149,7 @@ public abstract class ConfigRegistry
public void init ()
{
// read in the initial configuration settings from the persistent config repository
Class cclass = object.getClass();
Class<?> cclass = object.getClass();
try {
Field[] fields = cclass.getFields();
for (int ii = 0; ii < fields.length; ii++) {
@@ -172,19 +171,19 @@ public abstract class ConfigRegistry
}
// from SetListener
public void entryAdded (EntryAddedEvent event)
public void entryAdded (EntryAddedEvent<DSet.Entry> event)
{
serializeAttribute(event.getName());
}
// from SetListener
public void entryUpdated (EntryUpdatedEvent event)
public void entryUpdated (EntryUpdatedEvent<DSet.Entry> event)
{
serializeAttribute(event.getName());
}
// from SetListener
public void entryRemoved (EntryRemovedEvent event)
public void entryRemoved (EntryRemovedEvent<DSet.Entry> event)
{
serializeAttribute(event.getName());
}
@@ -252,7 +251,7 @@ public abstract class ConfigRegistry
protected void initField (Field field)
{
String key = nameToKey(field.getName());
Class type = field.getType();
Class<?> type = field.getType();
try {
if (type.equals(Boolean.TYPE)) {