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
@@ -196,7 +196,7 @@ public class InvocationManager
* @return the Class, or null if no dispatcher is registered with
* the specified code.
*/
public Class getDispatcherClass (int invCode)
public Class<?> getDispatcherClass (int invCode)
{
Object dispatcher = _dispatchers.get(invCode);
return (dispatcher == null) ? null : dispatcher.getClass();
@@ -233,7 +233,7 @@ public class InvocationManager
}
// look up the dispatcher
InvocationDispatcher disp = _dispatchers.get(invCode);
InvocationDispatcher<?> disp = _dispatchers.get(invCode);
if (disp == null) {
log.info("Received invocation request but dispatcher " +
"registration was already cleared [code=" + invCode +
@@ -317,7 +317,7 @@ public class InvocationManager
protected PresentsDObjectMgr _omgr;
/** A table of invocation dispatchers each mapped by a unique code. */
protected IntMap<InvocationDispatcher> _dispatchers = IntMaps.newHashIntMap();
protected IntMap<InvocationDispatcher<?>> _dispatchers = IntMaps.newHashIntMap();
/** Maps bootstrap group to lists of services to be provided to clients at boot time. */
protected Map<String, List<InvocationMarshaller>> _bootlists = Maps.newHashMap();
@@ -90,7 +90,7 @@ public class PresentsClient
*
* @param rl when this method is finished with its business and the old client object can
* be destroyed, the result listener should be called. */
void changeReported (ClientObject newObji, ResultListener rl);
void changeReported (ClientObject newObji, ResultListener<Void> rl);
/** Called when the user change is completed, the old client object is destroyed and all
* updates are committed. */
@@ -210,8 +210,8 @@ public class PresentsClient
// let the caller know that we've got some new business
if (ucl != null) {
ucl.changeReported(clobj, new ResultListener() {
public void requestCompleted (Object result) {
ucl.changeReported(clobj, new ResultListener<Void>() {
public void requestCompleted (Void result) {
finishResolved(username, clobj);
}
public void requestFailed (Exception cause) {
@@ -402,7 +402,7 @@ public class PresentsDObjectMgr
// if this object has any oid list fields that are still referencing other objects, we need
// to clear out those references
Class oclass = target.getClass();
Class<?> oclass = target.getClass();
Field[] fields = oclass.getFields();
for (int f = 0; f < fields.length; f++) {
Field field = fields[f];
@@ -626,7 +626,7 @@ public class PresentsDObjectMgr
cname = StringUtil.shortClassName(ival);
} else if (unit instanceof InvocationRequestEvent) {
InvocationRequestEvent ire = (InvocationRequestEvent)unit;
Class c = _invmgr.getDispatcherClass(ire.getInvCode());
Class<?> c = _invmgr.getDispatcherClass(ire.getInvCode());
cname = (c == null) ? "dobj.InvocationRequestEvent:(no longer registered)" :
StringUtil.shortClassName(c) + ":" + ire.getMethodId();
} else {
@@ -645,7 +645,7 @@ public class PresentsDObjectMgr
*/
protected void processCompoundEvent (CompoundEvent event)
{
List events = event.getEvents();
List<DEvent> events = event.getEvents();
int ecount = events.size();
// look up the target object
@@ -657,7 +657,7 @@ public class PresentsDObjectMgr
// check the permissions on all of the events
for (int ii = 0; ii < ecount; ii++) {
DEvent sevent = (DEvent)events.get(ii);
DEvent sevent = events.get(ii);
if (!target.checkPermissions(sevent)) {
log.warning("Event failed permissions check [event=" + sevent +
", target=" + target + "].");
@@ -667,7 +667,7 @@ public class PresentsDObjectMgr
// dispatch the events
for (int ii = 0; ii < ecount; ii++) {
dispatchEvent((DEvent)events.get(ii), target);
dispatchEvent(events.get(ii), target);
}
// always notify proxies of compound events
@@ -810,7 +810,7 @@ public class PresentsDObjectMgr
*/
protected void registerEventHelpers ()
{
Class[] ptypes = new Class[] { DEvent.class, DObject.class };
Class<?>[] ptypes = new Class<?>[] { DEvent.class, DObject.class };
Method method;
try {
@@ -1030,7 +1030,7 @@ public class PresentsDObjectMgr
protected Stats _recent = new Stats(), _current = _recent;
/** Maps event classes to helpers that perform additional processing for particular events. */
protected Map<Class, Method> _helpers = Maps.newHashMap();
protected Map<Class<?>, Method> _helpers = Maps.newHashMap();
/** Used to resolve unit names when profiling. Injected by the invmgr when it's created. */
protected InvocationManager _invmgr;
@@ -78,7 +78,7 @@ public class PresentsInvoker extends Invoker
for (Object key : _tracker.keySet()) {
UnitProfile profile = _tracker.get(key);
if (key instanceof Class) {
key = StringUtil.shortClassName((Class)key);
key = StringUtil.shortClassName((Class<?>)key);
}
buf.append(" ").append(key).append(" ");
buf.append(profile).append("\n");
@@ -44,7 +44,7 @@ public class PresentsObjectAccess
public static AccessController DEFAULT = new AccessController()
{
// documentation inherited from interface
public boolean allowSubscribe (DObject object, Subscriber subscriber)
public boolean allowSubscribe (DObject object, Subscriber<?> subscriber)
{
// allow anyone to subscribe
return true;
@@ -70,12 +70,13 @@ public class PresentsObjectAccess
public static AccessController CLIENT = new AccessController()
{
// documentation inherited from interface
public boolean allowSubscribe (DObject object, Subscriber sub)
public boolean allowSubscribe (DObject object, Subscriber<?> sub)
{
boolean allowed = true;
// if the subscriber is a client, ensure that they are this same user
if (sub instanceof PresentsClient) {
allowed = ((PresentsClient)sub).getClientObject() == object;
if (PresentsClient.class.isInstance(sub)) {
@SuppressWarnings("unchecked") PresentsClient client = (PresentsClient)sub;
allowed = (client.getClientObject() == object);
if (!allowed) {
log.warning("Refusing ClientObject subscription request " +
"[obj=" + ((ClientObject)object).who() + ", sub=" + sub + "].");
@@ -81,7 +81,7 @@ public class PresentsServer
if (testmod != null) {
try {
log.info("Invoking test module [mod=" + testmod + "].");
Class tmclass = Class.forName(testmod);
Class<?> tmclass = Class.forName(testmod);
Runnable trun = (Runnable)tmclass.newInstance();
trun.run();
} catch (Exception e) {
@@ -45,7 +45,6 @@ public class TimeBaseDispatcher extends InvocationDispatcher<TimeBaseMarshaller>
return new TimeBaseMarshaller();
}
@SuppressWarnings("unchecked")
@Override // documentation inherited
public void dispatchRequest (
ClientObject source, int methodId, Object[] args)