[Fb-contrib-commit] SF.net SVN: fb-contrib:[1579] trunk/fb-contrib
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2010-07-16 04:17:20
|
Revision: 1579
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1579&view=rev
Author: dbrosius
Date: 2010-07-16 04:17:14 +0000 (Fri, 16 Jul 2010)
Log Message:
-----------
don't report PRMC for System.currentTimeMillis
Modified Paths:
--------------
trunk/fb-contrib/samples/PRMC_Sample.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
Modified: trunk/fb-contrib/samples/PRMC_Sample.java
===================================================================
--- trunk/fb-contrib/samples/PRMC_Sample.java 2010-07-10 19:11:41 UTC (rev 1578)
+++ trunk/fb-contrib/samples/PRMC_Sample.java 2010-07-16 04:17:14 UTC (rev 1579)
@@ -69,4 +69,13 @@
{
}
}
+
+ public long fpCurrentTimeMillis(Object o)
+ {
+ long time = -System.currentTimeMillis();
+ o.hashCode();
+ time += System.currentTimeMillis();
+
+ return time;
+ }
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2010-07-10 19:11:41 UTC (rev 1578)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2010-07-16 04:17:14 UTC (rev 1579)
@@ -21,7 +21,6 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -80,7 +79,7 @@
if (userNameProp != null) {
String[] userNames = userNameProp.split("\\s*,\\s*");
for (String name : userNames)
- riskyMethodNameContents.add(name.toLowerCase(Locale.getDefault()));
+ riskyMethodNameContents.add(name);
}
Integer prop = Integer.getInteger(PRMC_HIGH_BYTECOUNT);
if (prop != null)
@@ -108,7 +107,7 @@
}
}
- private BugReporter bugReporter;
+ private final BugReporter bugReporter;
private OpcodeStack stack = null;
private Map<Integer, MethodCall> localMethodCalls = null;
private Map<String, MethodCall> fieldMethodCalls = null;
@@ -288,7 +287,6 @@
if (riskyClassNames.contains(className))
return true;
- methodName = methodName.toLowerCase(Locale.ENGLISH);
for (String riskyName : riskyMethodNameContents) {
if (methodName.indexOf(riskyName) >= 0)
return true;
@@ -301,9 +299,9 @@
*/
static class MethodCall
{
- private String methodName;
- private String methodSignature;
- private Object[] methodParms;
+ private final String methodName;
+ private final String methodSignature;
+ private final Object[] methodParms;
public MethodCall(String name, String signature, Object[] parms) {
methodName = name;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|