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:
@@ -27,7 +27,7 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.util.Integer;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link BureauService} interface
|
||||
* Provides the implementation of the <code>BureauService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -36,7 +36,7 @@ import com.threerings.util.Integer;
|
||||
public class BureauMarshaller extends InvocationMarshaller
|
||||
implements BureauService
|
||||
{
|
||||
/** The method id used to dispatch {@link #agentCreated} requests. */
|
||||
/** The method id used to dispatch <code>agentCreated</code> requests. */
|
||||
public static const AGENT_CREATED :int = 1;
|
||||
|
||||
// from interface BureauService
|
||||
@@ -47,7 +47,7 @@ public class BureauMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #agentCreationFailed} requests. */
|
||||
/** The method id used to dispatch <code>agentCreationFailed</code> requests. */
|
||||
public static const AGENT_CREATION_FAILED :int = 2;
|
||||
|
||||
// from interface BureauService
|
||||
@@ -58,7 +58,7 @@ public class BureauMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #agentDestroyed} requests. */
|
||||
/** The method id used to dispatch <code>agentDestroyed</code> requests. */
|
||||
public static const AGENT_DESTROYED :int = 3;
|
||||
|
||||
// from interface BureauService
|
||||
@@ -69,7 +69,7 @@ public class BureauMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #bureauInitialized} requests. */
|
||||
/** The method id used to dispatch <code>bureauInitialized</code> requests. */
|
||||
public static const BUREAU_INITIALIZED :int = 4;
|
||||
|
||||
// from interface BureauService
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
|
||||
import com.threerings.util.Name;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link ChatService} interface
|
||||
* Provides the implementation of the <code>ChatService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -39,7 +39,7 @@ import com.threerings.util.Name;
|
||||
public class ChatMarshaller extends InvocationMarshaller
|
||||
implements ChatService
|
||||
{
|
||||
/** The method id used to dispatch {@link #away} requests. */
|
||||
/** The method id used to dispatch <code>away</code> requests. */
|
||||
public static const AWAY :int = 1;
|
||||
|
||||
// from interface ChatService
|
||||
@@ -50,7 +50,7 @@ public class ChatMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #broadcast} requests. */
|
||||
/** The method id used to dispatch <code>broadcast</code> requests. */
|
||||
public static const BROADCAST :int = 2;
|
||||
|
||||
// from interface ChatService
|
||||
@@ -63,7 +63,7 @@ public class ChatMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #tell} requests. */
|
||||
/** The method id used to dispatch <code>tell</code> requests. */
|
||||
public static const TELL :int = 3;
|
||||
|
||||
// from interface ChatService
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.threerings.util.Long;
|
||||
public class ChatMarshaller_TellMarshaller
|
||||
extends InvocationMarshaller_ListenerMarshaller
|
||||
{
|
||||
/** The method id used to dispatch {@link #tellSucceeded} responses. */
|
||||
/** The method id used to dispatch <code>tellSucceeded</code> responses. */
|
||||
public static const TELL_SUCCEEDED :int = 1;
|
||||
|
||||
// from InvocationMarshaller_ListenerMarshaller
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.util.Byte;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link SpeakService} interface
|
||||
* Provides the implementation of the <code>SpeakService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -36,7 +36,7 @@ import com.threerings.util.Byte;
|
||||
public class SpeakMarshaller extends InvocationMarshaller
|
||||
implements SpeakService
|
||||
{
|
||||
/** The method id used to dispatch {@link #speak} requests. */
|
||||
/** The method id used to dispatch <code>speak</code> requests. */
|
||||
public static const SPEAK :int = 1;
|
||||
|
||||
// from interface SpeakService
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.util.langBoolean;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link BodyService} interface
|
||||
* Provides the implementation of the <code>BodyService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -36,7 +36,7 @@ import com.threerings.util.langBoolean;
|
||||
public class BodyMarshaller extends InvocationMarshaller
|
||||
implements BodyService
|
||||
{
|
||||
/** The method id used to dispatch {@link #setIdle} requests. */
|
||||
/** The method id used to dispatch <code>setIdle</code> requests. */
|
||||
public static const SET_IDLE :int = 1;
|
||||
|
||||
// from interface BodyService
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.threerings.presents.data.InvocationMarshaller;
|
||||
import com.threerings.util.Integer;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link LocationService} interface
|
||||
* Provides the implementation of the <code>LocationService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -37,7 +37,7 @@ import com.threerings.util.Integer;
|
||||
public class LocationMarshaller extends InvocationMarshaller
|
||||
implements LocationService
|
||||
{
|
||||
/** The method id used to dispatch {@link #leavePlace} requests. */
|
||||
/** The method id used to dispatch <code>leavePlace</code> requests. */
|
||||
public static const LEAVE_PLACE :int = 1;
|
||||
|
||||
// from interface LocationService
|
||||
@@ -48,7 +48,7 @@ public class LocationMarshaller extends InvocationMarshaller
|
||||
]);
|
||||
}
|
||||
|
||||
/** The method id used to dispatch {@link #moveTo} requests. */
|
||||
/** The method id used to dispatch <code>moveTo</code> requests. */
|
||||
public static const MOVE_TO :int = 2;
|
||||
|
||||
// from interface LocationService
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller;
|
||||
public class LocationMarshaller_MoveMarshaller
|
||||
extends InvocationMarshaller_ListenerMarshaller
|
||||
{
|
||||
/** The method id used to dispatch {@link #moveSucceeded} responses. */
|
||||
/** The method id used to dispatch <code>moveSucceeded</code> responses. */
|
||||
public static const MOVE_SUCCEEDED :int = 1;
|
||||
|
||||
// from InvocationMarshaller_ListenerMarshaller
|
||||
|
||||
@@ -26,7 +26,7 @@ import com.threerings.presents.client.TimeBaseService;
|
||||
import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener;
|
||||
|
||||
/**
|
||||
* Provides the implementation of the {@link TimeBaseService} interface
|
||||
* Provides the implementation of the <code>TimeBaseService</code> interface
|
||||
* that marshalls the arguments and delivers the request to the provider
|
||||
* on the server. Also provides an implementation of the response listener
|
||||
* interfaces that marshall the response arguments and deliver them back
|
||||
@@ -35,7 +35,7 @@ import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener;
|
||||
public class TimeBaseMarshaller extends InvocationMarshaller
|
||||
implements TimeBaseService
|
||||
{
|
||||
/** The method id used to dispatch {@link #getTimeOid} requests. */
|
||||
/** The method id used to dispatch <code>getTimeOid</code> requests. */
|
||||
public static const GET_TIME_OID :int = 1;
|
||||
|
||||
// from interface TimeBaseService
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.threerings.presents.client.TimeBaseService_GotTimeBaseListener;
|
||||
public class TimeBaseMarshaller_GotTimeBaseMarshaller
|
||||
extends InvocationMarshaller_ListenerMarshaller
|
||||
{
|
||||
/** The method id used to dispatch {@link #gotTimeOid} responses. */
|
||||
/** The method id used to dispatch <code>gotTimeOid</code> responses. */
|
||||
public static const GOT_TIME_OID :int = 1;
|
||||
|
||||
// from InvocationMarshaller_ListenerMarshaller
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
* @param setName The name of the set in the object.
|
||||
* @param entryClass the Class of the DSet.Entry elements contained in the set.
|
||||
*/
|
||||
public DSetEditor (DObject setter, String setName, Class entryClass)
|
||||
public DSetEditor (DObject setter, String setName, Class<?> entryClass)
|
||||
{
|
||||
this(setter, setName, entryClass, null);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
* @param entryClass the Class of the DSet.Entry elements contained in the set.
|
||||
* @param editableFields the names of the fields in the entryClass that should be editable.
|
||||
*/
|
||||
public DSetEditor (DObject setter, String setName, Class entryClass,
|
||||
public DSetEditor (DObject setter, String setName, Class<?> entryClass,
|
||||
String[] editableFields)
|
||||
{
|
||||
this(setter, setName, entryClass, editableFields, null);
|
||||
@@ -85,7 +85,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
* @param editableFields the names of the fields in the entryClass that should be editable.
|
||||
* @param interp The FieldInterpreter to use.
|
||||
*/
|
||||
public DSetEditor (DObject setter, String setName, Class entryClass,
|
||||
public DSetEditor (DObject setter, String setName, Class<?> entryClass,
|
||||
String[] editableFields, ObjectEditorTable.FieldInterpreter interp)
|
||||
{
|
||||
super(new BorderLayout());
|
||||
@@ -147,8 +147,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
{
|
||||
if (event.getName().equals(_setName)) {
|
||||
E entry = event.getEntry();
|
||||
@SuppressWarnings("unchecked") Comparable<Object> key = entry.getKey();
|
||||
int index = _keys.insertSorted(key);
|
||||
int index = _keys.insertSorted(getKey(entry));
|
||||
_table.insertDatum(entry, index);
|
||||
}
|
||||
}
|
||||
@@ -157,7 +156,7 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
public void entryRemoved (EntryRemovedEvent<E> event)
|
||||
{
|
||||
if (event.getName().equals(_setName)) {
|
||||
Comparable key = event.getKey();
|
||||
Comparable<?> key = event.getKey();
|
||||
int index = _keys.indexOf(key);
|
||||
_keys.remove(index);
|
||||
_table.removeDatum(index);
|
||||
@@ -197,12 +196,17 @@ public class DSetEditor<E extends DSet.Entry> extends JPanel
|
||||
@SuppressWarnings("unchecked") E[] entries = (E[])new DSet.Entry[_set.size()];
|
||||
_set.toArray(entries);
|
||||
for (int ii = 0; ii < entries.length; ii++) {
|
||||
@SuppressWarnings("unchecked") Comparable<Object> key = entries[ii].getKey();
|
||||
_keys.insertSorted(key);
|
||||
_keys.insertSorted(getKey(entries[ii]));
|
||||
}
|
||||
_table.setData(entries); // this works because DSet itself is sorted
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected static Comparable<Object> getKey (DSet.Entry entry)
|
||||
{
|
||||
return (Comparable<Object>)entry.getKey();
|
||||
}
|
||||
|
||||
/** The object that contains the set we're displaying. */
|
||||
protected DObject _setter;
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ public class AdminDispatcher extends InvocationDispatcher<AdminMarshaller>
|
||||
return new AdminMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -67,7 +67,6 @@ import static com.threerings.admin.Log.log;
|
||||
*/
|
||||
public abstract class ConfigRegistry
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a ConfigRegistry that isn't transitioning.
|
||||
*/
|
||||
@@ -138,7 +137,7 @@ public abstract class ConfigRegistry
|
||||
* Contains all necessary info for a configuration object registration.
|
||||
*/
|
||||
protected abstract class ObjectRecord
|
||||
implements AttributeChangeListener, SetListener, ElementUpdateListener
|
||||
implements AttributeChangeListener, SetListener<DSet.Entry>, ElementUpdateListener
|
||||
{
|
||||
public DObject object;
|
||||
|
||||
@@ -150,7 +149,7 @@ public abstract class ConfigRegistry
|
||||
public void init ()
|
||||
{
|
||||
// read in the initial configuration settings from the persistent config repository
|
||||
Class cclass = object.getClass();
|
||||
Class<?> cclass = object.getClass();
|
||||
try {
|
||||
Field[] fields = cclass.getFields();
|
||||
for (int ii = 0; ii < fields.length; ii++) {
|
||||
@@ -172,19 +171,19 @@ public abstract class ConfigRegistry
|
||||
}
|
||||
|
||||
// from SetListener
|
||||
public void entryAdded (EntryAddedEvent event)
|
||||
public void entryAdded (EntryAddedEvent<DSet.Entry> event)
|
||||
{
|
||||
serializeAttribute(event.getName());
|
||||
}
|
||||
|
||||
// from SetListener
|
||||
public void entryUpdated (EntryUpdatedEvent event)
|
||||
public void entryUpdated (EntryUpdatedEvent<DSet.Entry> event)
|
||||
{
|
||||
serializeAttribute(event.getName());
|
||||
}
|
||||
|
||||
// from SetListener
|
||||
public void entryRemoved (EntryRemovedEvent event)
|
||||
public void entryRemoved (EntryRemovedEvent<DSet.Entry> event)
|
||||
{
|
||||
serializeAttribute(event.getName());
|
||||
}
|
||||
@@ -252,7 +251,7 @@ public abstract class ConfigRegistry
|
||||
protected void initField (Field field)
|
||||
{
|
||||
String key = nameToKey(field.getName());
|
||||
Class type = field.getType();
|
||||
Class<?> type = field.getType();
|
||||
|
||||
try {
|
||||
if (type.equals(Boolean.TYPE)) {
|
||||
|
||||
@@ -46,7 +46,6 @@ public class BureauDispatcher extends InvocationDispatcher<BureauMarshaller>
|
||||
return new BureauMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ChatDirector extends BasicDirector
|
||||
/**
|
||||
* Called when the list of chatters has been changed.
|
||||
*/
|
||||
void chattersUpdated (Iterator chatternames);
|
||||
void chattersUpdated (Iterator<Name> chatternames);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,6 @@ public class ChatDispatcher extends InvocationDispatcher<ChatMarshaller>
|
||||
return new ChatMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -46,7 +46,6 @@ public class SpeakDispatcher extends InvocationDispatcher<SpeakMarshaller>
|
||||
return new SpeakMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -57,7 +57,7 @@ import com.threerings.crowd.util.CrowdContext;
|
||||
* what's in the cache.
|
||||
*/
|
||||
public class OccupantDirector extends BasicDirector
|
||||
implements LocationObserver, SetListener
|
||||
implements LocationObserver, SetListener<OccupantInfo>
|
||||
{
|
||||
/**
|
||||
* Constructs a new occupant director with the supplied context.
|
||||
@@ -148,7 +148,7 @@ public class OccupantDirector extends BasicDirector
|
||||
/**
|
||||
* Deals with all of the processing when an occupant shows up.
|
||||
*/
|
||||
public void entryAdded (EntryAddedEvent event)
|
||||
public void entryAdded (EntryAddedEvent<OccupantInfo> event)
|
||||
{
|
||||
// bail if this isn't for the OCCUPANT_INFO field
|
||||
if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) {
|
||||
@@ -156,7 +156,7 @@ public class OccupantDirector extends BasicDirector
|
||||
}
|
||||
|
||||
// now let the occupant observers know what's up
|
||||
final OccupantInfo info = (OccupantInfo)event.getEntry();
|
||||
final OccupantInfo info = event.getEntry();
|
||||
_observers.apply(new ObserverList.ObserverOp<OccupantObserver>() {
|
||||
public boolean apply (OccupantObserver observer) {
|
||||
observer.occupantEntered(info);
|
||||
@@ -168,7 +168,7 @@ public class OccupantDirector extends BasicDirector
|
||||
/**
|
||||
* Deals with all of the processing when an occupant is updated.
|
||||
*/
|
||||
public void entryUpdated (EntryUpdatedEvent event)
|
||||
public void entryUpdated (EntryUpdatedEvent<OccupantInfo> event)
|
||||
{
|
||||
// bail if this isn't for the OCCUPANT_INFO field
|
||||
if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) {
|
||||
@@ -176,8 +176,8 @@ public class OccupantDirector extends BasicDirector
|
||||
}
|
||||
|
||||
// now let the occupant observers know what's up
|
||||
final OccupantInfo info = (OccupantInfo)event.getEntry();
|
||||
final OccupantInfo oinfo = (OccupantInfo)event.getOldEntry();
|
||||
final OccupantInfo info = event.getEntry();
|
||||
final OccupantInfo oinfo = event.getOldEntry();
|
||||
_observers.apply(new ObserverList.ObserverOp<OccupantObserver>() {
|
||||
public boolean apply (OccupantObserver observer) {
|
||||
observer.occupantUpdated(oinfo, info);
|
||||
@@ -189,7 +189,7 @@ public class OccupantDirector extends BasicDirector
|
||||
/**
|
||||
* Deals with all of the processing when an occupant leaves.
|
||||
*/
|
||||
public void entryRemoved (EntryRemovedEvent event)
|
||||
public void entryRemoved (EntryRemovedEvent<OccupantInfo> event)
|
||||
{
|
||||
// bail if this isn't for the OCCUPANT_INFO field
|
||||
if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) {
|
||||
@@ -197,7 +197,7 @@ public class OccupantDirector extends BasicDirector
|
||||
}
|
||||
|
||||
// let the occupant observers know what's up
|
||||
final OccupantInfo oinfo = (OccupantInfo)event.getOldEntry();
|
||||
final OccupantInfo oinfo = event.getOldEntry();
|
||||
_observers.apply(new ObserverList.ObserverOp<OccupantObserver>() {
|
||||
public boolean apply (OccupantObserver observer) {
|
||||
observer.occupantLeft(oinfo);
|
||||
@@ -207,8 +207,7 @@ public class OccupantDirector extends BasicDirector
|
||||
}
|
||||
|
||||
/** The occupant observers to keep abreast of occupant antics. */
|
||||
protected ObserverList<OccupantObserver> _observers =
|
||||
new ObserverList<OccupantObserver>(ObserverList.SAFE_IN_ORDER_NOTIFY);
|
||||
protected ObserverList<OccupantObserver> _observers = ObserverList.newSafeInOrder();
|
||||
|
||||
/** The user's current location. */
|
||||
protected PlaceObject _place;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class OccupantInfo extends SimpleStreamableObject
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return bodyOid;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public abstract class PlaceConfig extends SimpleStreamableObject
|
||||
* @deprecated Override {@link #createController} directly.
|
||||
*/
|
||||
@Deprecated
|
||||
public Class getControllerClass ()
|
||||
public Class<?> getControllerClass ()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public abstract class PlaceConfig extends SimpleStreamableObject
|
||||
*/
|
||||
public PlaceController createController ()
|
||||
{
|
||||
Class cclass = getControllerClass();
|
||||
Class<?> cclass = getControllerClass();
|
||||
if (cclass == null) {
|
||||
throw new RuntimeException(
|
||||
"PlaceConfig.createController() must be overridden.");
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
|
||||
package com.threerings.crowd.data;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
@@ -124,9 +122,7 @@ public class PlaceObject extends DObject
|
||||
public OccupantInfo getOccupantInfo (Name username)
|
||||
{
|
||||
try {
|
||||
Iterator iter = occupantInfo.iterator();
|
||||
while (iter.hasNext()) {
|
||||
OccupantInfo info = (OccupantInfo)iter.next();
|
||||
for (OccupantInfo info : occupantInfo) {
|
||||
if (info.username.equals(username)) {
|
||||
return info;
|
||||
}
|
||||
@@ -181,7 +177,7 @@ public class PlaceObject extends DObject
|
||||
* the <code>occupantInfo</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFromOccupantInfo (Comparable key)
|
||||
public void removeFromOccupantInfo (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove(OCCUPANT_INFO, occupantInfo, key);
|
||||
}
|
||||
@@ -209,8 +205,7 @@ public class PlaceObject extends DObject
|
||||
public void setOccupantInfo (DSet<OccupantInfo> value)
|
||||
{
|
||||
requestAttributeChange(OCCUPANT_INFO, value, this.occupantInfo);
|
||||
@SuppressWarnings("unchecked") DSet<OccupantInfo> clone =
|
||||
(value == null) ? null : value.typedClone();
|
||||
DSet<OccupantInfo> clone = (value == null) ? null : value.typedClone();
|
||||
this.occupantInfo = clone;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CrowdClientInfo extends ClientInfo
|
||||
public Name visibleName;
|
||||
|
||||
@Override // documentation inherited
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
// the PeerManager works in such a way that we can override our client
|
||||
// info key and things still work properly; all inter-server
|
||||
|
||||
@@ -49,7 +49,6 @@ public class CrowdPeerDispatcher extends InvocationDispatcher<CrowdPeerMarshalle
|
||||
return new CrowdPeerMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -46,7 +46,6 @@ public class BodyDispatcher extends InvocationDispatcher<BodyMarshaller>
|
||||
return new BodyMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -43,10 +43,11 @@ public class CrowdObjectAccess
|
||||
public static AccessController PLACE = new AccessController()
|
||||
{
|
||||
// documentation inherited from interface
|
||||
public boolean allowSubscribe (DObject object, Subscriber sub)
|
||||
public boolean allowSubscribe (DObject object, Subscriber<?> sub)
|
||||
{
|
||||
if (sub instanceof CrowdClient) {
|
||||
ClientObject co = ((CrowdClient)sub).getClientObject();
|
||||
if (CrowdClient.class.isInstance(sub)) {
|
||||
@SuppressWarnings("unchecked") ClientObject co =
|
||||
((CrowdClient)sub).getClientObject();
|
||||
return ((PlaceObject)object).occupants.contains(co.getOid());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -47,7 +47,6 @@ public class LocationDispatcher extends InvocationDispatcher<LocationMarshaller>
|
||||
return new LocationMarshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.samskivert.util.StringUtil;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
import com.threerings.presents.dobj.AccessController;
|
||||
import com.threerings.presents.dobj.DObject;
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.DynamicListener;
|
||||
import com.threerings.presents.dobj.EntryUpdatedEvent;
|
||||
import com.threerings.presents.dobj.MessageEvent;
|
||||
@@ -381,13 +382,13 @@ public class PlaceManager
|
||||
|
||||
// Lazily create our dispatcher now that it's actually getting a message
|
||||
if (_dispatcher == null) {
|
||||
Class clazz = getClass();
|
||||
Class<?> clazz = getClass();
|
||||
MethodFinder finder = _dispatcherFinders.get(clazz);
|
||||
if (finder == null) {
|
||||
finder = new MethodFinder(clazz);
|
||||
_dispatcherFinders.put(clazz, finder);
|
||||
}
|
||||
_dispatcher = new DynamicListener(this, finder);
|
||||
_dispatcher = new DynamicListener<DSet.Entry>(this, finder);
|
||||
}
|
||||
_dispatcher.dispatchMethod(event.getName(), nargs);
|
||||
}
|
||||
@@ -707,11 +708,11 @@ public class PlaceManager
|
||||
}
|
||||
|
||||
/** Listens for occupant updates. */
|
||||
protected SetAdapter _bodyUpdater = new SetAdapter() {
|
||||
protected SetAdapter<OccupantInfo> _bodyUpdater = new SetAdapter<OccupantInfo>() {
|
||||
@Override
|
||||
public void entryUpdated (EntryUpdatedEvent event) {
|
||||
public void entryUpdated (EntryUpdatedEvent<OccupantInfo> event) {
|
||||
if (event.getName().equals(PlaceObject.OCCUPANT_INFO)) {
|
||||
bodyUpdated((OccupantInfo)event.getEntry());
|
||||
bodyUpdated(event.getEntry());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -748,7 +749,7 @@ public class PlaceManager
|
||||
protected Interval _shutdownInterval;
|
||||
|
||||
/** Used to do method lookup magic when we receive message events. */
|
||||
protected DynamicListener _dispatcher;
|
||||
protected DynamicListener<?> _dispatcher;
|
||||
|
||||
/** Maps from a PlaceManager subclass to a MethodFinder for it. When there are many many
|
||||
* instances of a PlaceManager in existence, having a MethodFinder instance for each gets quite
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.RandomAccess;
|
||||
public class BasicStreamers
|
||||
{
|
||||
/** An array of types for all of the basic streamers. */
|
||||
public static Class[] BSTREAMER_TYPES = {
|
||||
public static Class<?>[] BSTREAMER_TYPES = {
|
||||
Boolean.class,
|
||||
Byte.class,
|
||||
Short.class,
|
||||
@@ -419,7 +419,7 @@ public class BasicStreamers
|
||||
public void writeObject (Object object, ObjectOutputStream out, boolean useWriter)
|
||||
throws IOException
|
||||
{
|
||||
writeList(out, (List)object);
|
||||
writeList(out, (List<?>)object);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ public class BasicStreamers
|
||||
return value;
|
||||
}
|
||||
|
||||
public static ArrayList readList (ObjectInputStream ins)
|
||||
public static ArrayList<?> readList (ObjectInputStream ins)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
int ecount = ins.readInt();
|
||||
@@ -637,7 +637,7 @@ public class BasicStreamers
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeList (ObjectOutputStream out, List value)
|
||||
public static void writeList (ObjectOutputStream out, List<?> value)
|
||||
throws IOException
|
||||
{
|
||||
int ecount = value.size();
|
||||
|
||||
@@ -28,10 +28,10 @@ package com.threerings.io;
|
||||
class ClassMapping
|
||||
{
|
||||
public short code;
|
||||
public Class sclass;
|
||||
public Class<?> sclass;
|
||||
public Streamer streamer;
|
||||
|
||||
public ClassMapping (short code, Class sclass, Streamer streamer)
|
||||
public ClassMapping (short code, Class<?> sclass, Streamer streamer)
|
||||
{
|
||||
this.code = code;
|
||||
this.sclass = sclass;
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class FieldMarshaller
|
||||
}
|
||||
}
|
||||
|
||||
Class ftype = field.getType();
|
||||
Class<?> ftype = field.getType();
|
||||
if (ftype.isInterface()) {
|
||||
// if the class is a pure interface, use Object.
|
||||
ftype = Object.class;
|
||||
@@ -212,7 +212,7 @@ public abstract class FieldMarshaller
|
||||
protected static void createMarshallers ()
|
||||
{
|
||||
// create our table
|
||||
_marshallers = new HashMap<Class, FieldMarshaller>();
|
||||
_marshallers = new HashMap<Class<?>, FieldMarshaller>();
|
||||
|
||||
// create a generic marshaller for streamable instances
|
||||
FieldMarshaller gmarsh = new FieldMarshaller() {
|
||||
@@ -354,11 +354,11 @@ public abstract class FieldMarshaller
|
||||
}
|
||||
|
||||
/** Contains a mapping from field type to field marshaller instance for that type. */
|
||||
protected static HashMap<Class, FieldMarshaller> _marshallers;
|
||||
protected static HashMap<Class<?>, FieldMarshaller> _marshallers;
|
||||
|
||||
/** Defines the signature to a custom field reader method. */
|
||||
protected static final Class[] READER_ARGS = { ObjectInputStream.class };
|
||||
protected static final Class<?>[] READER_ARGS = { ObjectInputStream.class };
|
||||
|
||||
/** Defines the signature to a custom field writer method. */
|
||||
protected static final Class[] WRITER_ARGS = { ObjectOutputStream.class };
|
||||
protected static final Class<?>[] WRITER_ARGS = { ObjectOutputStream.class };
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class ObjectInputStream extends DataInputStream
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
// resolve the class and streamer
|
||||
Class sclass = Class.forName(cname, true, _loader);
|
||||
Class<?> sclass = Class.forName(cname, true, _loader);
|
||||
Streamer streamer = Streamer.getStreamer(sclass);
|
||||
if (STREAM_DEBUG) {
|
||||
log.info(hashCode() + ": New class '" + cname + "' [code=" + code + "].");
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.io.OutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.threerings.NaryaLog.log;
|
||||
|
||||
@@ -71,11 +72,11 @@ public class ObjectOutputStream extends DataOutputStream
|
||||
|
||||
// create our classmap if necessary
|
||||
if (_classmap == null) {
|
||||
_classmap = new HashMap<Class, ClassMapping>();
|
||||
_classmap = new HashMap<Class<?>, ClassMapping>();
|
||||
}
|
||||
|
||||
// otherwise, look up the class mapping record
|
||||
Class sclass = Streamer.getStreamerClass(object);
|
||||
Class<?> sclass = Streamer.getStreamerClass(object);
|
||||
ClassMapping cmap = _classmap.get(sclass);
|
||||
|
||||
// create a class mapping for this class if we've not got one
|
||||
@@ -108,7 +109,7 @@ public class ObjectOutputStream extends DataOutputStream
|
||||
/**
|
||||
* Creates and returns a new class mapping.
|
||||
*/
|
||||
protected ClassMapping createClassMapping (short code, Class sclass, Streamer streamer)
|
||||
protected ClassMapping createClassMapping (short code, Class<?> sclass, Streamer streamer)
|
||||
{
|
||||
return new ClassMapping(code, sclass, streamer);
|
||||
}
|
||||
@@ -135,7 +136,7 @@ public class ObjectOutputStream extends DataOutputStream
|
||||
/**
|
||||
* Writes out the mapping for a class.
|
||||
*/
|
||||
protected void writeClassMapping (int code, Class sclass)
|
||||
protected void writeClassMapping (int code, Class<?> sclass)
|
||||
throws IOException
|
||||
{
|
||||
writeShort(code);
|
||||
@@ -200,7 +201,7 @@ public class ObjectOutputStream extends DataOutputStream
|
||||
|
||||
/** Used to map classes to numeric codes and the {@link Streamer} instance used to write
|
||||
* them. */
|
||||
protected HashMap<Class, ClassMapping> _classmap;
|
||||
protected Map<Class<?>, ClassMapping> _classmap;
|
||||
|
||||
/** A counter used to assign codes to streamed classes. */
|
||||
protected short _nextCode = 1;
|
||||
@@ -212,5 +213,5 @@ public class ObjectOutputStream extends DataOutputStream
|
||||
protected Streamer _streamer;
|
||||
|
||||
/** An optional set of class name translations to use when serializing objects. */
|
||||
protected HashMap<String, String> _translations;
|
||||
protected Map<String, String> _translations;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import java.security.PrivilegedActionException;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class Streamer
|
||||
/**
|
||||
* Returns true if the supplied target class can be streamed using a streamer.
|
||||
*/
|
||||
public synchronized static boolean isStreamable (Class target)
|
||||
public synchronized static boolean isStreamable (Class<?> target)
|
||||
{
|
||||
while (true) {
|
||||
// if we've got a streamer for it, it's good
|
||||
@@ -82,10 +83,10 @@ public class Streamer
|
||||
* object's natural class, but for enum values, that might be its declaring class as enums use
|
||||
* classes in a way that would otherwise pollute our id to class mapping space.
|
||||
*/
|
||||
public static Class getStreamerClass (Object object)
|
||||
public static Class<?> getStreamerClass (Object object)
|
||||
{
|
||||
return (object instanceof Enum) ?
|
||||
((Enum)object).getDeclaringClass() : object.getClass();
|
||||
((Enum<?>)object).getDeclaringClass() : object.getClass();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,7 +101,7 @@ public class Streamer
|
||||
* {@link Streamable} and is not one of the basic object types (@see {@link
|
||||
* ObjectOutputStream}).
|
||||
*/
|
||||
public synchronized static Streamer getStreamer (final Class target)
|
||||
public synchronized static Streamer getStreamer (final Class<?> target)
|
||||
throws IOException
|
||||
{
|
||||
// if we have not yet initialized ourselves, do so now
|
||||
@@ -211,7 +212,7 @@ public class Streamer
|
||||
// if someone serializes an enum to a file and then adds a value to the enum, changing the
|
||||
// ordinal assignments)
|
||||
if (_target.isEnum()) {
|
||||
out.writeUTF(((Enum)object).name());
|
||||
out.writeUTF(((Enum<?>)object).name());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -262,8 +263,9 @@ public class Streamer
|
||||
if (ObjectInputStream.STREAM_DEBUG) {
|
||||
log.info(in.hashCode() + ": Creating enum '" + _target.getName() + "'.");
|
||||
}
|
||||
@SuppressWarnings("unchecked") Object value = Enum.valueOf(_target, in.readUTF());
|
||||
return value;
|
||||
@SuppressWarnings("unchecked") Class<EnumReader> eclass =
|
||||
(Class<EnumReader>)_target;
|
||||
return Enum.valueOf(eclass, in.readUTF());
|
||||
|
||||
} else {
|
||||
if (ObjectInputStream.STREAM_DEBUG) {
|
||||
@@ -482,7 +484,7 @@ public class Streamer
|
||||
*/
|
||||
protected static void createStreamers ()
|
||||
{
|
||||
_streamers = new HashMap<Class, Streamer>();
|
||||
_streamers = new HashMap<Class<?>, Streamer>();
|
||||
|
||||
// register all of the basic streamers
|
||||
int bscount = BasicStreamers.BSTREAMER_TYPES.length;
|
||||
@@ -491,9 +493,12 @@ public class Streamer
|
||||
BasicStreamers.BSTREAMER_INSTANCES[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Used to coerce the type system into quietude when reading enums from the wire. */
|
||||
protected static enum EnumReader { NOT_USED };
|
||||
|
||||
/** The class for which this streamer instance is configured. */
|
||||
protected Class _target;
|
||||
protected Class<?> _target;
|
||||
|
||||
/** If our target class is an array, this is a reference to a streamer that can stream our
|
||||
* array elements, otherwise it is null. */
|
||||
@@ -513,7 +518,7 @@ public class Streamer
|
||||
protected Method _writer;
|
||||
|
||||
/** Contains the mapping from class names to configured streamer instances. */
|
||||
protected static HashMap<Class, Streamer> _streamers;
|
||||
protected static Map<Class<?>, Streamer> _streamers;
|
||||
|
||||
/** A simple predicate to filter "NotStreamable" members from a Streamable object's fields. */
|
||||
protected static final Predicate<Field> _isStreamableFieldPred = new Predicate<Field>() {
|
||||
@@ -526,11 +531,11 @@ public class Streamer
|
||||
protected static final String READER_METHOD_NAME = "readObject";
|
||||
|
||||
/** The argument list for the custom reader method. */
|
||||
protected static final Class[] READER_ARGS = { ObjectInputStream.class };
|
||||
protected static final Class<?>[] READER_ARGS = { ObjectInputStream.class };
|
||||
|
||||
/** The name of the custom writer method. */
|
||||
protected static final String WRITER_METHOD_NAME = "writeObject";
|
||||
|
||||
/** The argument list for the custom writer method. */
|
||||
protected static final Class[] WRITER_ARGS = { ObjectOutputStream.class };
|
||||
protected static final Class<?>[] WRITER_ARGS = { ObjectOutputStream.class };
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
* Sets the reference to the set that will hold the classes for which mappings have been
|
||||
* written.
|
||||
*/
|
||||
public void setMappedClasses (Set<Class> mappedClasses)
|
||||
public void setMappedClasses (Set<Class<?>> mappedClasses)
|
||||
{
|
||||
_mappedClasses = mappedClasses;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
/**
|
||||
* Returns a reference to the set of classes for which mappings have been written.
|
||||
*/
|
||||
public Set<Class> getMappedClasses ()
|
||||
public Set<Class<?>> getMappedClasses ()
|
||||
{
|
||||
return _mappedClasses;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
* Notes that the receiver has received the mappings for a group of classes, and thus that from
|
||||
* now on, only the class codes need be sent.
|
||||
*/
|
||||
public void noteMappingsReceived (Collection<Class> sclasses)
|
||||
public void noteMappingsReceived (Collection<Class<?>> sclasses)
|
||||
{
|
||||
// sanity check
|
||||
if (_classmap == null) {
|
||||
@@ -54,7 +54,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
}
|
||||
|
||||
// make each class's code positive to signify that we no longer need to send metadata
|
||||
for (Class sclass : sclasses) {
|
||||
for (Class<?> sclass : sclasses) {
|
||||
ClassMapping cmap = _classmap.get(sclass);
|
||||
if (cmap == null) {
|
||||
throw new RuntimeException("No class mapping for " + sclass.getName());
|
||||
@@ -64,7 +64,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
}
|
||||
|
||||
@Override // documentation inherited
|
||||
protected ClassMapping createClassMapping (short code, Class sclass, Streamer streamer)
|
||||
protected ClassMapping createClassMapping (short code, Class<?> sclass, Streamer streamer)
|
||||
{
|
||||
// the negative class code indicates that we must rewrite the metadata for the first
|
||||
// instance in each go-round; when we are notified that the other side has cached the
|
||||
@@ -98,7 +98,7 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
}
|
||||
|
||||
@Override // documentation inherited
|
||||
protected void writeClassMapping (int code, Class sclass)
|
||||
protected void writeClassMapping (int code, Class<?> sclass)
|
||||
throws IOException
|
||||
{
|
||||
super.writeClassMapping(code, sclass);
|
||||
@@ -108,5 +108,5 @@ public class UnreliableObjectOutputStream extends ObjectOutputStream
|
||||
}
|
||||
|
||||
/** The set of classes for which we have written mappings. */
|
||||
protected Set<Class> _mappedClasses = new HashSet<Class>();
|
||||
protected Set<Class<?>> _mappedClasses = new HashSet<Class<?>>();
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public class Client
|
||||
* matches. <em>Note also:</em> this method cannot be called until after the client has
|
||||
* established a connection with the server and the distributed object manager is available.
|
||||
*/
|
||||
public void registerFlushDelay (Class objclass, long delay)
|
||||
public void registerFlushDelay (Class<?> objclass, long delay)
|
||||
{
|
||||
ClientDObjectMgr omgr = (ClientDObjectMgr)getDObjectManager();
|
||||
omgr.registerFlushDelay(objclass, delay);
|
||||
|
||||
@@ -401,7 +401,7 @@ public class ClientDObjectMgr
|
||||
* This is guaranteed to be invoked via the invoker and can safely do main thread type things
|
||||
* like call back to the subscriber.
|
||||
*/
|
||||
protected void doUnsubscribe (int oid, Subscriber target)
|
||||
protected void doUnsubscribe (int oid, Subscriber<?> target)
|
||||
{
|
||||
DObject dobj = _ocache.get(oid);
|
||||
if (dobj != null) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public interface InvocationReceiver
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return receiverCode;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public class ClientObject extends DObject
|
||||
* the <code>receivers</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFromReceivers (Comparable key)
|
||||
public void removeFromReceivers (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove(RECEIVERS, receivers, key);
|
||||
}
|
||||
@@ -167,8 +167,7 @@ public class ClientObject extends DObject
|
||||
public void setReceivers (DSet<InvocationReceiver.Registration> value)
|
||||
{
|
||||
requestAttributeChange(RECEIVERS, value, this.receivers);
|
||||
@SuppressWarnings("unchecked") DSet<InvocationReceiver.Registration> clone =
|
||||
(value == null) ? null : value.typedClone();
|
||||
DSet<InvocationReceiver.Registration> clone = (value == null) ? null : value.typedClone();
|
||||
this.receivers = clone;
|
||||
}
|
||||
// AUTO-GENERATED: METHODS END
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface AccessController
|
||||
* Should return true if the supplied subscriber is allowed to
|
||||
* subscribe to the specified object.
|
||||
*/
|
||||
boolean allowSubscribe (DObject object, Subscriber subscriber);
|
||||
boolean allowSubscribe (DObject object, Subscriber<?> subscriber);
|
||||
|
||||
/**
|
||||
* Should return true if the supplied event is legal for dispatch on
|
||||
|
||||
@@ -131,7 +131,7 @@ public class AttributeChangedEvent extends NamedEvent
|
||||
_oldValue = target.getAttribute(_name);
|
||||
Object value = _value;
|
||||
if (value != null) {
|
||||
Class vclass = value.getClass();
|
||||
Class<?> vclass = value.getClass();
|
||||
if (vclass.isPrimitive()) {
|
||||
// do nothing; we check this to avoid the more expensive isAssignableFrom check
|
||||
// on primitives which are far and away the most common case
|
||||
@@ -141,7 +141,7 @@ public class AttributeChangedEvent extends NamedEvent
|
||||
System.arraycopy(value, 0, clone, 0, length);
|
||||
value = clone;
|
||||
} else if (DSet.class.isAssignableFrom(vclass)) {
|
||||
value = ((DSet)value).clone();
|
||||
value = ((DSet<?>)value).clone();
|
||||
}
|
||||
}
|
||||
// pass the new value on to the object
|
||||
|
||||
@@ -202,7 +202,7 @@ public abstract class DEvent implements Streamable
|
||||
/** Used to differentiate between null meaning we haven't initialized our old entry and null
|
||||
* being the actual old entry. */
|
||||
protected static final DSet.Entry UNSET_OLD_ENTRY = new DSet.Entry() {
|
||||
public Comparable getKey () {
|
||||
public Comparable<?> getKey () {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,7 +25,9 @@ import java.lang.reflect.Field;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.samskivert.util.ListUtil;
|
||||
import com.samskivert.util.StringUtil;
|
||||
@@ -151,7 +153,7 @@ public class DObject
|
||||
*
|
||||
* @see DObjectManager#subscribeToObject
|
||||
*/
|
||||
public void addSubscriber (Subscriber sub)
|
||||
public void addSubscriber (Subscriber<?> sub)
|
||||
{
|
||||
// only add the subscriber if they're not already there
|
||||
Object[] subs = ListUtil.testAndAddRef(_subs, sub);
|
||||
@@ -175,7 +177,7 @@ public class DObject
|
||||
*
|
||||
* @see DObjectManager#unsubscribeFromObject
|
||||
*/
|
||||
public void removeSubscriber (Subscriber sub)
|
||||
public void removeSubscriber (Subscriber<?> sub)
|
||||
{
|
||||
if (ListUtil.clearRef(_subs, sub) != null) {
|
||||
// if we removed something, check to see if we just removed the last subscriber from
|
||||
@@ -291,7 +293,7 @@ public class DObject
|
||||
/**
|
||||
* Request to have the specified key removed from the specified DSet.
|
||||
*/
|
||||
public void removeFromSet (String setName, Comparable key)
|
||||
public void removeFromSet (String setName, Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove(setName, getSet(setName), key);
|
||||
}
|
||||
@@ -377,7 +379,7 @@ public class DObject
|
||||
*
|
||||
* @return true if the subscriber has access to the object, false if they do not.
|
||||
*/
|
||||
public boolean checkPermissions (Subscriber sub)
|
||||
public boolean checkPermissions (Subscriber<?> sub)
|
||||
{
|
||||
if (_controller != null) {
|
||||
return _controller.allowSubscribe(this, sub);
|
||||
@@ -814,7 +816,7 @@ public class DObject
|
||||
* Calls by derived instances when a set remover method was called.
|
||||
*/
|
||||
protected <T extends DSet.Entry> void requestEntryRemove (
|
||||
String name, DSet<T> set, Comparable key)
|
||||
String name, DSet<T> set, Comparable<?> key)
|
||||
{
|
||||
// if we're on the authoritative server, we update the set immediately
|
||||
T oldEntry = null;
|
||||
@@ -913,7 +915,7 @@ public class DObject
|
||||
protected transient boolean _deathWish = false;
|
||||
|
||||
/** Maintains a mapping of sorted field arrays for each distributed object class. */
|
||||
protected static HashMap<Class, Field[]> _ftable = new HashMap<Class, Field[]>();
|
||||
protected static Map<Class<?>, Field[]> _ftable = Maps.newHashMap();
|
||||
|
||||
/** Used to sort and search {@link #_fields}. */
|
||||
protected static final Comparator<Field> FIELD_COMP = new Comparator<Field>() {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class DSet<E extends DSet.Entry>
|
||||
* Each entry provide an associated key which is used to determine its uniqueness in the
|
||||
* set. See the {@link DSet} class documentation for further information.
|
||||
*/
|
||||
Comparable getKey ();
|
||||
Comparable<?> getKey ();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,6 +82,17 @@ public class DSet<E extends DSet.Entry>
|
||||
return new DSet<E>(source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares the first comparable to the second. This is useful to avoid type safety warnings
|
||||
* when dealing with the keys of {@link DSet.Entry} values.
|
||||
*/
|
||||
public static int compare (Comparable<?> c1, Comparable<?> c2)
|
||||
{
|
||||
@SuppressWarnings("unchecked") Comparable<Object> cc1 = (Comparable<Object>)c1;
|
||||
@SuppressWarnings("unchecked") Comparable<Object> cc2 = (Comparable<Object>)c2;
|
||||
return cc1.compareTo(cc2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a distributed set and populates it with values from the supplied iterator. This
|
||||
* should be done before the set is unleashed into the wild distributed object world because no
|
||||
@@ -161,7 +172,7 @@ public class DSet<E extends DSet.Entry>
|
||||
* Returns true if an entry in the set has a key that <code>equals()</code> the supplied
|
||||
* key. Returns false otherwise.
|
||||
*/
|
||||
public boolean containsKey (Comparable key)
|
||||
public boolean containsKey (Comparable<?> key)
|
||||
{
|
||||
return get(key) != null;
|
||||
}
|
||||
@@ -170,7 +181,7 @@ public class DSet<E extends DSet.Entry>
|
||||
* Returns the entry that matches (<code>getKey().equals(key)</code>) the specified key or null
|
||||
* if no entry could be found that matches the key.
|
||||
*/
|
||||
public E get (Comparable key)
|
||||
public E get (Comparable<?> key)
|
||||
{
|
||||
// determine where we'll be adding the new element
|
||||
int eidx = ArrayUtil.binarySearch(_entries, 0, _size, new KeyWrapper(key), ENTRY_COMP);
|
||||
@@ -325,7 +336,7 @@ public class DSet<E extends DSet.Entry>
|
||||
*
|
||||
* @return the old matching entry if found and removed, null if not found.
|
||||
*/
|
||||
protected E removeKey (Comparable key)
|
||||
protected E removeKey (Comparable<?> key)
|
||||
{
|
||||
// don't fail, but generate a warning if we're passed a null key
|
||||
if (key == null) {
|
||||
@@ -461,13 +472,13 @@ public class DSet<E extends DSet.Entry>
|
||||
/** Used to search for keys. */
|
||||
protected static class KeyWrapper implements DSet.Entry
|
||||
{
|
||||
public KeyWrapper (Comparable key) {
|
||||
public KeyWrapper (Comparable<?> key) {
|
||||
_key = key;
|
||||
}
|
||||
public Comparable getKey () {
|
||||
public Comparable<?> getKey () {
|
||||
return _key;
|
||||
}
|
||||
protected Comparable _key;
|
||||
protected Comparable<?> _key;
|
||||
}
|
||||
|
||||
/** The entries of the set (in a sparse array). */
|
||||
@@ -485,8 +496,7 @@ public class DSet<E extends DSet.Entry>
|
||||
/** Used for lookups and to keep the set contents sorted on insertions. */
|
||||
protected static Comparator<Entry> ENTRY_COMP = new Comparator<Entry>() {
|
||||
public int compare (Entry e1, Entry e2) {
|
||||
@SuppressWarnings("unchecked") int val = e1.getKey().compareTo(e2.getKey());
|
||||
return val;
|
||||
return DSet.compare(e1.getKey(), e2.getKey());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@ import static com.threerings.presents.Log.log;
|
||||
/**
|
||||
* Maps distributed object events to methods using reflection.
|
||||
*/
|
||||
public class DynamicListener
|
||||
implements AttributeChangeListener, ElementUpdateListener, SetListener
|
||||
public class DynamicListener<T extends DSet.Entry>
|
||||
implements AttributeChangeListener, ElementUpdateListener, SetListener<T>
|
||||
{
|
||||
/**
|
||||
* Creates a listener that dynamically dispatches events on the supplied
|
||||
@@ -70,21 +70,21 @@ public class DynamicListener
|
||||
}
|
||||
|
||||
// from interface SetListener
|
||||
public void entryAdded (EntryAddedEvent event)
|
||||
public void entryAdded (EntryAddedEvent<T> event)
|
||||
{
|
||||
dispatchMethod(event.getName() + "Added",
|
||||
new Object[] { event.getEntry() });
|
||||
}
|
||||
|
||||
// from interface SetListener
|
||||
public void entryUpdated (EntryUpdatedEvent event)
|
||||
public void entryUpdated (EntryUpdatedEvent<T> event)
|
||||
{
|
||||
dispatchMethod(event.getName() + "Updated",
|
||||
new Object[] { event.getEntry() });
|
||||
}
|
||||
|
||||
// from interface SetListener
|
||||
public void entryRemoved (EntryRemovedEvent event)
|
||||
public void entryRemoved (EntryRemovedEvent<T> event)
|
||||
{
|
||||
dispatchMethod(event.getName() + "Removed",
|
||||
new Object[] { event.getKey() });
|
||||
@@ -120,7 +120,7 @@ public class DynamicListener
|
||||
*/
|
||||
protected Method resolveMethod (String name, Object[] arguments)
|
||||
{
|
||||
Class[] ptypes = new Class[arguments.length];
|
||||
Class<?>[] ptypes = new Class<?>[arguments.length];
|
||||
for (int ii = 0; ii < arguments.length; ii++) {
|
||||
ptypes[ii] = arguments[ii] == null ?
|
||||
null : arguments[ii].getClass();
|
||||
|
||||
@@ -167,7 +167,7 @@ public class ElementUpdatedEvent extends NamedEvent
|
||||
try {
|
||||
// fetch the array field from the object
|
||||
Field field = target.getClass().getField(_name);
|
||||
Class ftype = field.getType();
|
||||
Class<?> ftype = field.getType();
|
||||
|
||||
// sanity check
|
||||
if (!ftype.isArray()) {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
* @param key the entry key that identifies the entry to remove.
|
||||
* @param oldEntry the previous value of the entry.
|
||||
*/
|
||||
public EntryRemovedEvent (int targetOid, String name, Comparable key, T oldEntry)
|
||||
public EntryRemovedEvent (int targetOid, String name, Comparable<?> key, T oldEntry)
|
||||
{
|
||||
super(targetOid, name);
|
||||
_key = key;
|
||||
@@ -62,7 +62,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
/**
|
||||
* Returns the key that identifies the entry that has been removed.
|
||||
*/
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return _key;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class EntryRemovedEvent<T extends DSet.Entry> extends NamedEvent
|
||||
buf.append(", key=").append(_key);
|
||||
}
|
||||
|
||||
protected Comparable _key;
|
||||
protected Comparable<?> _key;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected transient T _oldEntry = (T)UNSET_OLD_ENTRY;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -184,7 +184,7 @@ public class ActionScriptSource
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String createActionScriptDeclaration (Constructor ctor, boolean needsNoArg)
|
||||
public static String createActionScriptDeclaration (Constructor<?> ctor, boolean needsNoArg)
|
||||
{
|
||||
int mods = ctor.getModifiers();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
@@ -262,7 +262,7 @@ public class ActionScriptSource
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static String toActionScriptType (Class type, boolean isField)
|
||||
public static String toActionScriptType (Class<?> type, boolean isField)
|
||||
{
|
||||
if (type.isArray()) {
|
||||
if (Byte.TYPE.equals(type.getComponentType())) {
|
||||
@@ -294,11 +294,11 @@ public class ActionScriptSource
|
||||
return toSimpleName(type.getName());
|
||||
}
|
||||
|
||||
public ActionScriptSource (Class jclass)
|
||||
public ActionScriptSource (Class<?> jclass)
|
||||
{
|
||||
packageName = jclass.getPackage().getName();
|
||||
className = jclass.getName().substring(packageName.length()+1);
|
||||
Class sclass = jclass.getSuperclass();
|
||||
Class<?> sclass = jclass.getSuperclass();
|
||||
if (sclass != null && !sclass.getName().equals("java.lang.Object")) {
|
||||
superClassName = toSimpleName(sclass.getName());
|
||||
}
|
||||
@@ -306,7 +306,7 @@ public class ActionScriptSource
|
||||
|
||||
// note our implemented interfaces
|
||||
ArrayList<String> ifaces = new ArrayList<String>();
|
||||
for (Class iclass : jclass.getInterfaces()) {
|
||||
for (Class<?> iclass : jclass.getInterfaces()) {
|
||||
// we cannot use the FooCodes interface pattern in ActionScript so we just nix it
|
||||
if (iclass.getName().endsWith("Codes")) {
|
||||
continue;
|
||||
|
||||
@@ -95,7 +95,7 @@ public class GenActionScriptBundlesTask extends Task
|
||||
if (true) {
|
||||
// create an array with all the values, then populate in a loop
|
||||
out.println(" var data :Array = [");
|
||||
for (Map.Entry entry : props.entrySet()) {
|
||||
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
||||
String key = saveConvert((String) entry.getKey());
|
||||
String val = saveConvert((String) entry.getValue());
|
||||
out.println(" \"" + key + "\", \"" + val + "\",");
|
||||
@@ -110,7 +110,7 @@ public class GenActionScriptBundlesTask extends Task
|
||||
// alternate impl: just set each value directly. For non-trivial
|
||||
// resource bundles, this generates a larger class after compilation
|
||||
out.println(" var o :Object = new Object();");
|
||||
for (Map.Entry entry : props.entrySet()) {
|
||||
for (Map.Entry<Object, Object> entry : props.entrySet()) {
|
||||
String key = saveConvert((String) entry.getKey());
|
||||
String val = saveConvert((String) entry.getValue());
|
||||
out.println(" o[\"" + key + "\"] = \"" + val + "\";");
|
||||
|
||||
@@ -246,7 +246,7 @@ public class GenActionScriptTask extends Task
|
||||
return !Modifier.isStatic(mods) && !Modifier.isTransient(mods);
|
||||
}
|
||||
|
||||
protected String toReadObject (Class type)
|
||||
protected String toReadObject (Class<?> type)
|
||||
{
|
||||
if (type.equals(String.class)) {
|
||||
return "(ins.readField(String) as String)";
|
||||
@@ -296,7 +296,7 @@ public class GenActionScriptTask extends Task
|
||||
}
|
||||
}
|
||||
|
||||
protected String toWriteObject (Class type, String name)
|
||||
protected String toWriteObject (Class<?> type, String name)
|
||||
{
|
||||
if (type.equals(Integer.class)) {
|
||||
return "writeObject(new Integer(" + name + "))";
|
||||
|
||||
@@ -142,7 +142,7 @@ public class GenDObjectTask extends Task
|
||||
}
|
||||
|
||||
/** Processes a resolved distributed object class instance. */
|
||||
protected void processObject (File source, Class oclass)
|
||||
protected void processObject (File source, Class<?> oclass)
|
||||
{
|
||||
// make sure we extend distributed object
|
||||
if (!_doclass.isAssignableFrom(oclass) || _doclass.equals(oclass)) {
|
||||
@@ -226,8 +226,7 @@ public class GenDObjectTask extends Task
|
||||
if (t instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType)t;
|
||||
if (pt.getActualTypeArguments().length > 0) {
|
||||
ctx.put("etype", GenUtil.simpleName(
|
||||
(Class<?>)pt.getActualTypeArguments()[0]));
|
||||
ctx.put("etype", GenUtil.simpleName(pt.getActualTypeArguments()[0]));
|
||||
}
|
||||
} else {
|
||||
ctx.put("etype", "DSet.Entry");
|
||||
|
||||
@@ -46,7 +46,7 @@ import com.threerings.presents.server.InvocationSender;
|
||||
public class GenReceiverTask extends InvocationTask
|
||||
{
|
||||
@Override
|
||||
protected void processService (File source, Class receiver)
|
||||
protected void processService (File source, Class<?> receiver)
|
||||
{
|
||||
System.out.println("Processing " + receiver.getName() + "...");
|
||||
String rname = receiver.getName();
|
||||
@@ -92,7 +92,7 @@ public class GenReceiverTask extends InvocationTask
|
||||
}
|
||||
|
||||
protected void generateSender (File source, String rname, String rpackage,
|
||||
List methods, Iterator<String> imports)
|
||||
List<?> methods, Iterator<String> imports)
|
||||
{
|
||||
String name = StringUtil.replace(rname, "Receiver", "");
|
||||
String spackage = StringUtil.replace(rpackage, ".client", ".server");
|
||||
@@ -130,8 +130,7 @@ public class GenReceiverTask extends InvocationTask
|
||||
}
|
||||
|
||||
protected void generateDecoder (
|
||||
File source, String rname, String rpackage, List methods,
|
||||
Iterator<String> imports)
|
||||
File source, String rname, String rpackage, List<?> methods, Iterator<String> imports)
|
||||
{
|
||||
String name = StringUtil.replace(rname, "Receiver", "");
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GenServiceTask extends InvocationTask
|
||||
/** Used to keep track of custom InvocationListener derivations. */
|
||||
public class ServiceListener implements Comparable<ServiceListener>
|
||||
{
|
||||
public Class listener;
|
||||
public Class<?> listener;
|
||||
|
||||
public ComparableArrayList<ServiceMethod> methods =
|
||||
new ComparableArrayList<ServiceMethod>();
|
||||
@@ -65,7 +65,7 @@ public class GenServiceTask extends InvocationTask
|
||||
/** Contains all imports required for the parameters of the methods in this listener. */
|
||||
public ImportSet imports = new ImportSet();
|
||||
|
||||
public ServiceListener (Class service, Class listener)
|
||||
public ServiceListener (Class<?> service, Class<?> listener)
|
||||
{
|
||||
this.listener = listener;
|
||||
Method[] methdecls = listener.getDeclaredMethods();
|
||||
@@ -141,7 +141,7 @@ public class GenServiceTask extends InvocationTask
|
||||
|
||||
// documentation inherited
|
||||
@Override
|
||||
protected void processService (File source, Class service)
|
||||
protected void processService (File source, Class<?> service)
|
||||
{
|
||||
System.out.println("Processing " + service.getName() + "...");
|
||||
|
||||
@@ -303,7 +303,7 @@ public class GenServiceTask extends InvocationTask
|
||||
|
||||
// ----------- Part III - as listener marshallers
|
||||
|
||||
Class imlm = InvocationMarshaller.ListenerMarshaller.class;
|
||||
Class<?> imlm = InvocationMarshaller.ListenerMarshaller.class;
|
||||
|
||||
// now generate ActionScript versions of our listener marshallers
|
||||
// because those have to be in separate files
|
||||
@@ -401,7 +401,7 @@ public class GenServiceTask extends InvocationTask
|
||||
|
||||
// ----------- Part V - as service listeners
|
||||
|
||||
Class isil = InvocationService.InvocationListener.class;
|
||||
Class<?> isil = InvocationService.InvocationListener.class;
|
||||
|
||||
// also generate ActionScript versions of any inner listener
|
||||
// interfaces because those have to be in separate files
|
||||
@@ -585,7 +585,7 @@ public class GenServiceTask extends InvocationTask
|
||||
/** Rolls up everything needed for the generate* methods. */
|
||||
protected class ServiceDescription
|
||||
{
|
||||
public Class service;
|
||||
public Class<?> service;
|
||||
public String sname;
|
||||
public String spackage;
|
||||
public ImportSet imports = new ImportSet();
|
||||
@@ -594,7 +594,7 @@ public class GenServiceTask extends InvocationTask
|
||||
public ComparableArrayList<ServiceListener> listeners =
|
||||
new ComparableArrayList<ServiceListener>();
|
||||
|
||||
public ServiceDescription (Class serviceClass)
|
||||
public ServiceDescription (Class<?> serviceClass)
|
||||
{
|
||||
service = serviceClass;
|
||||
sname = service.getSimpleName();
|
||||
@@ -611,7 +611,7 @@ public class GenServiceTask extends InvocationTask
|
||||
continue;
|
||||
}
|
||||
// check this method for custom listener declarations
|
||||
Class[] args = m.getParameterTypes();
|
||||
Class<?>[] args = m.getParameterTypes();
|
||||
for (int aa = 0; aa < args.length; aa++) {
|
||||
if (_ilistener.isAssignableFrom(args[aa]) &&
|
||||
GenUtil.simpleName(args[aa]).startsWith(sname + ".")) {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class GenStreamableTask extends Task
|
||||
StringBuffer writebuf = new StringBuffer(WRITE_OPEN);
|
||||
|
||||
// see if our parent also implements Streamable
|
||||
Class supster = sclass.getSuperclass();
|
||||
Class<?> supster = sclass.getSuperclass();
|
||||
do {
|
||||
if (isStreamableClass(supster)) {
|
||||
readbuf.append(" super.readObject(ins);\n");
|
||||
@@ -174,9 +174,9 @@ public class GenStreamableTask extends Task
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isStreamableClass (Class clazz)
|
||||
protected boolean isStreamableClass (Class<?> clazz)
|
||||
{
|
||||
for (Class iface : clazz.getInterfaces()) {
|
||||
for (Class<?> iface : clazz.getInterfaces()) {
|
||||
if (Streamable.class.equals(iface)) {
|
||||
return !SimpleStreamableObject.class.equals(clazz);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class GenUtil extends com.samskivert.util.GenUtil
|
||||
public static String simpleASName (Class<?> clazz)
|
||||
{
|
||||
if (clazz.isArray()) {
|
||||
Class compoType = clazz.getComponentType();
|
||||
Class<?> compoType = clazz.getComponentType();
|
||||
if (Byte.TYPE.equals(compoType)) {
|
||||
return "ByteArray";
|
||||
} else if (Object.class.equals(compoType)) {
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ImportSet
|
||||
* Adds the given class' name to the set of imports.
|
||||
* @param clazz the class to add
|
||||
*/
|
||||
public void add (Class clazz)
|
||||
public void add (Class<?> clazz)
|
||||
{
|
||||
_imports.add(clazz.getName());
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class InvocationTask extends Task
|
||||
{
|
||||
public int index;
|
||||
|
||||
public Class listener;
|
||||
public Class<?> listener;
|
||||
|
||||
public ListenerArgument (int index, Class<?> listener)
|
||||
{
|
||||
@@ -274,7 +274,7 @@ public abstract class InvocationTask extends Task
|
||||
protected String unboxArgument (Type type, int index, boolean listenerMode)
|
||||
{
|
||||
if (listenerMode && (type instanceof Class) &&
|
||||
_ilistener.isAssignableFrom((Class)type)) {
|
||||
_ilistener.isAssignableFrom((Class<?>)type)) {
|
||||
return "listener" + index;
|
||||
} else {
|
||||
return GenUtil.unboxArgument(type, "args[" + index + "]");
|
||||
@@ -385,7 +385,7 @@ public abstract class InvocationTask extends Task
|
||||
}
|
||||
|
||||
/** Processes a resolved invocation service class instance. */
|
||||
protected abstract void processService (File source, Class service);
|
||||
protected abstract void processService (File source, Class<?> service);
|
||||
|
||||
protected void writeFile (String path, String data)
|
||||
throws IOException
|
||||
|
||||
@@ -24,7 +24,6 @@ public class ${name}Dispatcher extends InvocationDispatcher<${name}Marshaller>
|
||||
return new ${name}Marshaller();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override // documentation inherited
|
||||
public void dispatchRequest (
|
||||
ClientObject source, int methodId, Object[] args)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* the <code>$field</code> set. The set will not change until the
|
||||
* event is actually propagated through the system.
|
||||
*/
|
||||
public void removeFrom$upfield (Comparable key)
|
||||
public void removeFrom$upfield (Comparable<?> key)
|
||||
{
|
||||
requestEntryRemove($capfield, $field, key);
|
||||
}
|
||||
@@ -41,7 +41,6 @@
|
||||
public void set$upfield ($type value)
|
||||
{
|
||||
requestAttributeChange($capfield, value, this.$field);
|
||||
@SuppressWarnings("unchecked") $type clone =
|
||||
$clonefield;
|
||||
$type clone = $clonefield;
|
||||
this.$field = clone;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ClassUtil
|
||||
*/
|
||||
public static Method getMethod (String name, Object target, Map<String, Method> cache)
|
||||
{
|
||||
Class tclass = target.getClass();
|
||||
Class<?> tclass = target.getClass();
|
||||
String key = tclass.getName() + ":" + name;
|
||||
Method method = cache.get(key);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ClassUtil
|
||||
*/
|
||||
public static Method getMethod (String name, Object target, Object[] args)
|
||||
{
|
||||
Class tclass = target.getClass();
|
||||
Class<?> tclass = target.getClass();
|
||||
Method meth = null;
|
||||
|
||||
try {
|
||||
@@ -98,7 +98,7 @@ public class ClassUtil
|
||||
* @return the method with the specified name or null if no method with that name could be
|
||||
* found.
|
||||
*/
|
||||
public static Method findMethod (Class clazz, String name)
|
||||
public static Method findMethod (Class<?> clazz, String name)
|
||||
{
|
||||
Method[] methods = clazz.getMethods();
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class DatagramSequencer
|
||||
_uout.writeInt(_lastReceived);
|
||||
|
||||
// make sure the mapped class set is clear
|
||||
Set<Class> mappedClasses = _uout.getMappedClasses();
|
||||
Set<Class<?>> mappedClasses = _uout.getMappedClasses();
|
||||
mappedClasses.clear();
|
||||
|
||||
// write the object
|
||||
@@ -69,7 +69,7 @@ public class DatagramSequencer
|
||||
if (mappedClasses.isEmpty()) {
|
||||
mappedClasses = null;
|
||||
} else {
|
||||
_uout.setMappedClasses(new HashSet<Class>());
|
||||
_uout.setMappedClasses(new HashSet<Class<?>>());
|
||||
}
|
||||
|
||||
// record the transmission
|
||||
@@ -123,9 +123,9 @@ public class DatagramSequencer
|
||||
|
||||
/** The set of classes for which mappings were included in the datagram (or
|
||||
* <code>null</code> for none). */
|
||||
public Set<Class> mappedClasses;
|
||||
public Set<Class<?>> mappedClasses;
|
||||
|
||||
public SendRecord (int number, Set<Class> mappedClasses)
|
||||
public SendRecord (int number, Set<Class<?>> mappedClasses)
|
||||
{
|
||||
this.number = number;
|
||||
this.mappedClasses = mappedClasses;
|
||||
|
||||
@@ -113,8 +113,8 @@ public class Name extends SimpleStreamableObject
|
||||
public boolean equals (Object other)
|
||||
{
|
||||
if (other != null) {
|
||||
Class c = getClass();
|
||||
Class oc = other.getClass();
|
||||
Class<?> c = getClass();
|
||||
Class<?> oc = other.getClass();
|
||||
// we have to be of the same derived class but we don't want to
|
||||
// wig out if the classes were loaded from different class loaders
|
||||
if (c == oc || c.getName().equals(oc.getName())) {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
|
||||
public static <E extends Enum<E>> StreamableEnumSet<E> copyOf (Collection<E> s)
|
||||
{
|
||||
if (s instanceof StreamableEnumSet) {
|
||||
@SuppressWarnings("unchecked") StreamableEnumSet<E> set = (StreamableEnumSet<E>)s;
|
||||
StreamableEnumSet<E> set = (StreamableEnumSet<E>)s;
|
||||
return copyOf(set);
|
||||
}
|
||||
if (s.isEmpty()) {
|
||||
@@ -197,7 +197,7 @@ public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
|
||||
if (!_elementType.isInstance(o)) {
|
||||
return false;
|
||||
}
|
||||
int ordinal = ((Enum)o).ordinal();
|
||||
int ordinal = ((Enum<?>)o).ordinal();
|
||||
int idx = ordinal >> 3, mask = 1 << (ordinal & 0x07);
|
||||
return (_contents[idx] & mask) != 0;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public class StreamableEnumSet<E extends Enum<E>> extends AbstractSet<E>
|
||||
if (!_elementType.isInstance(o)) {
|
||||
return false;
|
||||
}
|
||||
int ordinal = ((Enum)o).ordinal();
|
||||
int ordinal = ((Enum<?>)o).ordinal();
|
||||
int idx = ordinal >> 3, mask = 1 << (ordinal & 0x07);
|
||||
if ((_contents[idx] & mask) != 0) {
|
||||
_contents[idx] &= ~mask;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package com.threerings.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.samskivert.util.HashIntMap;
|
||||
|
||||
@@ -66,8 +65,7 @@ public class StreamableHashIntMap<V> extends HashIntMap<V>
|
||||
{
|
||||
int ecount = size();
|
||||
out.writeInt(ecount);
|
||||
for (Iterator iter = intEntrySet().iterator(); iter.hasNext(); ) {
|
||||
IntEntry entry = (IntEntry) iter.next();
|
||||
for (IntEntry<V> entry : intEntrySet()) {
|
||||
out.writeInt(entry.getIntKey());
|
||||
out.writeObject(entry.getValue());
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package com.threerings.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.samskivert.util.IntIntMap;
|
||||
|
||||
@@ -65,8 +64,7 @@ public class StreamableIntIntMap extends IntIntMap
|
||||
{
|
||||
int ecount = size();
|
||||
out.writeInt(ecount);
|
||||
for (Iterator itr = entrySet().iterator(); itr.hasNext(); ) {
|
||||
IntIntEntry entry = (IntIntEntry) itr.next();
|
||||
for (IntIntEntry entry : entrySet()) {
|
||||
out.writeInt(entry.getIntKey());
|
||||
out.writeInt(entry.getIntValue());
|
||||
}
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
|
||||
package com.threerings.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import com.samskivert.util.Tuple;
|
||||
|
||||
import static com.threerings.NaryaLog.log;
|
||||
@@ -56,7 +57,7 @@ public class TrackedObject
|
||||
/** Records that this object came into existence. */
|
||||
protected final void incrementInstanceCount ()
|
||||
{
|
||||
Class clazz = getClass();
|
||||
Class<?> clazz = getClass();
|
||||
synchronized (_map) {
|
||||
int[] count = _map.get(clazz);
|
||||
if (count == null) {
|
||||
@@ -71,7 +72,7 @@ public class TrackedObject
|
||||
protected void finalize ()
|
||||
throws Throwable
|
||||
{
|
||||
Class clazz = getClass();
|
||||
Class<?> clazz = getClass();
|
||||
synchronized (_map) {
|
||||
int[] count = _map.get(clazz);
|
||||
if (count != null) {
|
||||
@@ -90,23 +91,23 @@ public class TrackedObject
|
||||
* instances and an <code>int[]</code> array that represent the number
|
||||
* of outstanding instance of all {@link TrackedObject}s in the VM.
|
||||
*/
|
||||
public static Tuple<Class[], int[]> getSnapshot ()
|
||||
public static Tuple<Class<?>[], int[]> getSnapshot ()
|
||||
{
|
||||
Class[] classes = null;
|
||||
Class<?>[] classes = null;
|
||||
int[] counts = null;
|
||||
synchronized (_map) {
|
||||
classes = new Class[_map.size()];
|
||||
counts = new int[_map.size()];
|
||||
int idx = 0;
|
||||
for (Map.Entry<Class, int[]> entry : _map.entrySet()) {
|
||||
for (Map.Entry<Class<?>, int[]> entry : _map.entrySet()) {
|
||||
classes[idx] = entry.getKey();
|
||||
counts[idx] = entry.getValue()[0];
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
return new Tuple<Class[], int[]>(classes, counts);
|
||||
return new Tuple<Class<?>[], int[]>(classes, counts);
|
||||
}
|
||||
|
||||
/** Tracks a mapping from {@link Class} object to active count. */
|
||||
protected static HashMap<Class, int[]> _map = new HashMap<Class, int[]>();
|
||||
protected static Map<Class<?>, int[]> _map = Maps.newHashMap();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class DSetTest extends TestCase
|
||||
_value = new Integer(value);
|
||||
}
|
||||
|
||||
public Comparable getKey ()
|
||||
public Comparable<?> getKey ()
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user