Revision: 673
http://svn.sourceforge.net/fb-contrib/?rev=673&view=rev
Author: dbrosius
Date: 2006-10-17 19:24:01 -0700 (Tue, 17 Oct 2006)
Log Message:
-----------
if there key collisions, then insert a MethodInfo with 0, 0 in it, so that we don't get false positives
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2006-10-17 23:11:45 UTC (rev 672)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2006-10-18 02:24:01 UTC (rev 673)
@@ -28,7 +28,11 @@
hashCode <<= 8;
hashCode |= signature.hashCode();
- methodStatistics.put(getKey(className, methodName, signature), getValue(methodInfo));
+ Long key = getKey(className, methodName, signature);
+ if (methodStatistics.containsKey(key))
+ methodStatistics.put(key, getValue(new MethodInfo()));
+ else
+ methodStatistics.put(getKey(className, methodName, signature), getValue(methodInfo));
}
public MethodInfo getMethodStatistics(String className, String methodName, String signature) {
@@ -58,8 +62,8 @@
private MethodInfo buildMethodInfo(Long value) {
MethodInfo mi = new MethodInfo();
long v = value.longValue();
- mi.numBytes = (int)(v >> 32);
- mi.numMethodCalls = (int)(v & 0x0FFFFFFFF);
+ mi.numBytes = (int)(v >>> 32);
+ mi.numMethodCalls = (int)(v & 0x7FFFFFFF);
return mi;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|