I am of two minds whether this is the "right" way or not, but Eclipse's warnings sure think so. Since the generics portion has been erased we can only check against <?> but we at least are noting that it's a parameterized type.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6089 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Mike Thomas
2010-06-28 17:19:41 +00:00
parent bf34448cdb
commit 2f704712b2
@@ -255,7 +255,7 @@ public class DObject
weak ? new WeakReference<Object>(listener) : listener);
return;
}
boolean oweak = _listeners[idx] instanceof WeakReference;
boolean oweak = _listeners[idx] instanceof WeakReference<?>;
if (weak == oweak) {
log.warning("Refusing repeat listener registration",
"dobj", which(), "list", listener, new Exception());
@@ -468,7 +468,7 @@ public class DObject
if (listener == null) {
continue;
}
if (listener instanceof WeakReference) {
if (listener instanceof WeakReference<?>) {
if ((listener = ((WeakReference<?>)listener).get()) == null) {
_listeners[ii] = null;
continue;
@@ -1028,7 +1028,7 @@ public class DObject
}
for (int ii = 0, ll = _listeners.length; ii < ll; ii++) {
Object olistener = _listeners[ii];
if (olistener == listener || (olistener instanceof WeakReference &&
if (olistener == listener || (olistener instanceof WeakReference<?> &&
((WeakReference<?>)olistener).get() == listener)) {
return ii;
}