Some type safety, redundant cast removal, and other code hygiene.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4879 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-11-24 19:40:19 +00:00
parent 6eb2c79b19
commit 63db77667a
9 changed files with 22 additions and 34 deletions
@@ -28,8 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import sun.misc.Perf;
import com.samskivert.util.AuditLogger;
import com.samskivert.util.HashIntMap;
import com.samskivert.util.Histogram;
@@ -297,8 +295,7 @@ public class PresentsDObjectMgr
*/
protected void processUnit (Object unit)
{
long start = _timer.highResCounter();
long freq = _timer.highResFrequency();
long start = System.nanoTime();
// keep track of the largest queue size we've seen
int queueSize = _evqueue.size();
@@ -339,8 +336,7 @@ public class PresentsDObjectMgr
}
// compute the elapsed time in microseconds
long elapsed = _timer.highResCounter() - start;
elapsed = elapsed * 1000000 / freq;
long elapsed = (System.nanoTime() - start)/1000;
// report excessively long units
if (elapsed > 500000 && !(unit instanceof LongRunnable)) {
@@ -859,17 +855,16 @@ public class PresentsDObjectMgr
protected static void registerEventHelpers ()
{
Class[] ptypes = new Class[] { DEvent.class, DObject.class };
Class omgrcl = PresentsDObjectMgr.class;
Method method;
try {
method = omgrcl.getMethod("objectDestroyed", ptypes);
method = PresentsDObjectMgr.class.getMethod("objectDestroyed", ptypes);
_helpers.put(ObjectDestroyedEvent.class, method);
method = omgrcl.getMethod("objectAdded", ptypes);
method = PresentsDObjectMgr.class.getMethod("objectAdded", ptypes);
_helpers.put(ObjectAddedEvent.class, method);
method = omgrcl.getMethod("objectRemoved", ptypes);
method = PresentsDObjectMgr.class.getMethod("objectRemoved", ptypes);
_helpers.put(ObjectRemovedEvent.class, method);
} catch (Exception e) {
@@ -981,9 +976,6 @@ public class PresentsDObjectMgr
* thread. */
protected Thread _dobjThread;
/** Used during unit profiling for timing values. */
protected Perf _timer = Perf.getPerf();
/** A monotonically increasing counter used to assign an id to all dispatched events. */
protected long _nextEventId = 1;