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:
@@ -36,7 +36,7 @@ public class ClientInfo extends SimpleStreamableObject
|
||||
public Name username;
|
||||
|
||||
// documentation inherited from interface DSet.Entry
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
|
||||
@@ -65,13 +65,13 @@ public class NodeObject extends DObject
|
||||
public String type;
|
||||
|
||||
/** The resource identifier, which can be <code>null</code> for singleton resources. */
|
||||
public Comparable id;
|
||||
public Comparable<?> id;
|
||||
|
||||
public Lock ()
|
||||
{
|
||||
}
|
||||
|
||||
public Lock (String type, Comparable id)
|
||||
public Lock (String type, Comparable<?> id)
|
||||
{
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
@@ -84,12 +84,11 @@ public class NodeObject extends DObject
|
||||
if (v1 != 0 || id == null) {
|
||||
return v1;
|
||||
}
|
||||
@SuppressWarnings("unchecked") int v2 = id.compareTo(olock.id);
|
||||
return v2;
|
||||
return DSet.compare(id, olock.id);
|
||||
}
|
||||
|
||||
// documentation inherited from interface DSet.Entry
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
@@ -197,7 +196,7 @@ public class NodeObject extends DObject
|
||||
* the <code>clients</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFromClients (Comparable key)
|
||||
public void removeFromClients (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove(CLIENTS, clients, key);
|
||||
}
|
||||
@@ -225,8 +224,7 @@ public class NodeObject extends DObject
|
||||
public void setClients (DSet<ClientInfo> value)
|
||||
{
|
||||
requestAttributeChange(CLIENTS, value, this.clients);
|
||||
@SuppressWarnings("unchecked") DSet<ClientInfo> clone =
|
||||
(value == null) ? null : value.typedClone();
|
||||
DSet<ClientInfo> clone = (value == null) ? null : value.typedClone();
|
||||
this.clients = clone;
|
||||
}
|
||||
|
||||
@@ -245,7 +243,7 @@ public class NodeObject extends DObject
|
||||
* the <code>locks</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFromLocks (Comparable key)
|
||||
public void removeFromLocks (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove(LOCKS, locks, key);
|
||||
}
|
||||
@@ -273,8 +271,7 @@ public class NodeObject extends DObject
|
||||
public void setLocks (DSet<NodeObject.Lock> value)
|
||||
{
|
||||
requestAttributeChange(LOCKS, value, this.locks);
|
||||
@SuppressWarnings("unchecked") DSet<NodeObject.Lock> clone =
|
||||
(value == null) ? null : value.typedClone();
|
||||
DSet<NodeObject.Lock> clone = (value == null) ? null : value.typedClone();
|
||||
this.locks = clone;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ public class PeerDispatcher extends InvocationDispatcher<PeerMarshaller>
|
||||
return new PeerMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -989,7 +989,7 @@ public abstract class PeerManager
|
||||
* Handles a lock in a state of resolution.
|
||||
*/
|
||||
protected class LockHandler
|
||||
implements SetListener
|
||||
implements SetListener<NodeObject.Lock>
|
||||
{
|
||||
/** Listeners waiting for resolution. */
|
||||
public ResultListenerList<String> listeners = new ResultListenerList<String>();
|
||||
@@ -1116,7 +1116,7 @@ public abstract class PeerManager
|
||||
}
|
||||
|
||||
// documentation inherited from interface SetListener
|
||||
public void entryAdded (EntryAddedEvent event)
|
||||
public void entryAdded (EntryAddedEvent<NodeObject.Lock> event)
|
||||
{
|
||||
if (_acquire && event.getName().equals(NodeObject.LOCKS) &&
|
||||
event.getEntry().equals(_lock)) {
|
||||
@@ -1125,7 +1125,7 @@ public abstract class PeerManager
|
||||
}
|
||||
|
||||
// documentation inherited from interface SetListener
|
||||
public void entryRemoved (EntryRemovedEvent event)
|
||||
public void entryRemoved (EntryRemovedEvent<NodeObject.Lock> event)
|
||||
{
|
||||
if (!_acquire && event.getName().equals(NodeObject.LOCKS) &&
|
||||
event.getOldEntry().equals(_lock)) {
|
||||
@@ -1134,7 +1134,7 @@ public abstract class PeerManager
|
||||
}
|
||||
|
||||
// documentation inherited from interface SetListener
|
||||
public void entryUpdated (EntryUpdatedEvent event)
|
||||
public void entryUpdated (EntryUpdatedEvent<NodeObject.Lock> event)
|
||||
{
|
||||
if (!_acquire && event.getName().equals(NodeObject.LOCKS) &&
|
||||
event.getEntry().equals(_lock)) {
|
||||
|
||||
@@ -52,13 +52,13 @@ public class PeerUtil
|
||||
S createProviderProxy (Class<S> clazz, final T svc, final Client client)
|
||||
{
|
||||
return clazz.cast(Proxy.newProxyInstance(
|
||||
clazz.getClassLoader(), new Class[] { clazz },
|
||||
clazz.getClassLoader(), new Class<?>[] { clazz },
|
||||
new InvocationHandler() {
|
||||
public Object invoke (Object proxy, Method method, Object[] args)
|
||||
throws Throwable {
|
||||
Method smethod = _pmethods.get(method);
|
||||
if (smethod == null) {
|
||||
Class[] ptypes = method.getParameterTypes();
|
||||
Class<?>[] ptypes = method.getParameterTypes();
|
||||
ptypes[0] = Client.class;
|
||||
_pmethods.put(method, smethod = svc.getClass().getMethod(
|
||||
method.getName(), ptypes));
|
||||
|
||||
Reference in New Issue
Block a user