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)
|
public boolean allowSubscribe (DObject object, Subscriber<?> sub)
|
||||||
{
|
{
|
||||||
if (CrowdClient.class.isInstance(sub)) {
|
if (CrowdClient.class.isInstance(sub)) {
|
||||||
@SuppressWarnings("unchecked") ClientObject co =
|
ClientObject co = CrowdClient.class.cast(sub).getClientObject();
|
||||||
((CrowdClient)sub).getClientObject();
|
|
||||||
return ((PlaceObject)object).occupants.contains(co.getOid());
|
return ((PlaceObject)object).occupants.contains(co.getOid());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class PresentsObjectAccess
|
|||||||
boolean allowed = true;
|
boolean allowed = true;
|
||||||
// if the subscriber is a client, ensure that they are this same user
|
// if the subscriber is a client, ensure that they are this same user
|
||||||
if (PresentsClient.class.isInstance(sub)) {
|
if (PresentsClient.class.isInstance(sub)) {
|
||||||
@SuppressWarnings("unchecked") PresentsClient client = (PresentsClient)sub;
|
PresentsClient client = PresentsClient.class.cast(sub);
|
||||||
allowed = (client.getClientObject() == object);
|
allowed = (client.getClientObject() == object);
|
||||||
if (!allowed) {
|
if (!allowed) {
|
||||||
log.warning("Refusing ClientObject subscription request " +
|
log.warning("Refusing ClientObject subscription request " +
|
||||||
|
|||||||
Reference in New Issue
Block a user