Peskily, Eclipse and javac disagreed about whether this unchecked suppression
was necessary (javac claimed it was, Eclipse claimed it wasnt'). Fortunately, we can do everything with Class<FooClient> methods that avoid the need for supression entirely. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5275 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -46,8 +46,7 @@ public class CrowdObjectAccess
|
||||
public boolean allowSubscribe (DObject object, Subscriber<?> sub)
|
||||
{
|
||||
if (CrowdClient.class.isInstance(sub)) {
|
||||
@SuppressWarnings("unchecked") ClientObject co =
|
||||
((CrowdClient)sub).getClientObject();
|
||||
ClientObject co = CrowdClient.class.cast(sub).getClientObject();
|
||||
return ((PlaceObject)object).occupants.contains(co.getOid());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class PresentsObjectAccess
|
||||
boolean allowed = true;
|
||||
// if the subscriber is a client, ensure that they are this same user
|
||||
if (PresentsClient.class.isInstance(sub)) {
|
||||
@SuppressWarnings("unchecked") PresentsClient client = (PresentsClient)sub;
|
||||
PresentsClient client = PresentsClient.class.cast(sub);
|
||||
allowed = (client.getClientObject() == object);
|
||||
if (!allowed) {
|
||||
log.warning("Refusing ClientObject subscription request " +
|
||||
|
||||
Reference in New Issue
Block a user