More code hygiene. Need to do some fiddling to make dispatchers not generate

generics warnings when calling methods with generic types.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@698 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-08-01 14:40:54 +00:00
parent 7708bc96a6
commit bb0d6c5ba4
62 changed files with 292 additions and 274 deletions
@@ -45,7 +45,7 @@ public abstract class EntryFee extends SimpleStreamableObject
/**
* Attempts to reserve the entry fee.
*/
public abstract void reserveFee (BodyObject body, ResultListener listener);
public abstract void reserveFee (BodyObject body, ResultListener<Void> listener);
/**
* Returns the entry fee.
@@ -31,21 +31,20 @@ import com.threerings.presents.dobj.DSet;
* Contains information on a particular tourney participant.
*/
public class Participant extends SimpleStreamableObject
implements DSet.Entry, Comparable
implements DSet.Entry, Comparable<Participant>
{
/** The username of the participant. */
public Name username;
// documentation inherited from interface DSet.Entry
public Comparable getKey ()
public Comparable<?> getKey ()
{
return username;
}
// documentation inherited from interface Comparable
public int compareTo (Object o)
public int compareTo (Participant op)
{
Participant op = (Participant)o;
return username.compareTo(op.username);
}
@@ -50,7 +50,7 @@ public abstract class TourneyManager
*
* @return the oid of this manager's tourney object.
*/
public int init (TourneyConfig config, Comparable key)
public int init (TourneyConfig config, Comparable<?> key)
{
_config = config;
_key = key;
@@ -120,8 +120,8 @@ public abstract class TourneyManager
// make the assumption that they're going to get in
_trobj.addToParticipants(part);
ResultListener rl = new ResultListener() {
public void requestCompleted (Object result) {
ResultListener<Void> rl = new ResultListener<Void>() {
public void requestCompleted (Void result) {
listener.requestProcessed();
}
public void requestFailed (Exception cause) {
@@ -150,7 +150,7 @@ public abstract class TourneyManager
throw new InvocationException(TOO_LATE_LEAVE);
}
Comparable key = body.username;
Comparable<?> key = body.username;
if (!_trobj.participants.containsKey(key)) {
throw new InvocationException(NOT_IN_TOURNEY);
}
@@ -283,7 +283,7 @@ public abstract class TourneyManager
protected long _startTime;
/** The key this tourney is recorded under. */
protected Comparable _key;
protected Comparable<?> _key;
// services on which we depend
@Inject protected RootDObjectManager _omgr;
@@ -103,7 +103,7 @@ public abstract class TourniesManager
/**
* Called by the tourney manager to remove itself from the tournies.
*/
protected void releaseTourney (Comparable key)
protected void releaseTourney (Comparable<?> key)
{
_tourneys.remove(key);
}
@@ -148,7 +148,7 @@ public abstract class TourniesManager
protected int _tourneyCount;
/** Holds all the current tournies in the game. */
protected Map<Comparable, TourneyManager> _tourneys = Maps.newHashMap();
protected Map<Comparable<?>, TourneyManager> _tourneys = Maps.newHashMap();
// our dependencies
@Inject protected RootDObjectManager _omgr;