[Fb-contrib-commit] SF.net SVN: fb-contrib: [559] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/de
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-06-07 04:45:20
|
Revision: 559 Author: dbrosius Date: 2006-06-06 21:45:14 -0700 (Tue, 06 Jun 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=559&view=rev Log Message: ----------- add ability for user to add risky method name parts, thru system property 'fbcontrib.RMC.riskynames' Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java 2006-06-06 20:30:34 UTC (rev 558) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java 2006-06-07 04:45:14 UTC (rev 559) @@ -45,6 +45,8 @@ */ public class RedundantMethodCalls extends BytecodeScanningDetector { + public static final String RMC_RISKY_USER_KEY = "fbcontrib.RMC.riskynames"; + private static Set<String> riskyMethodNameContents = new HashSet<String>(); static { riskyMethodNameContents.add("next"); @@ -54,6 +56,13 @@ riskyMethodNameContents.add("remove"); riskyMethodNameContents.add("read"); riskyMethodNameContents.add("write"); + + String userNameProp = System.getProperty(RMC_RISKY_USER_KEY); + if (userNameProp != null) { + String[] userNames = userNameProp.split("\\s*,\\s*"); + for (String name : userNames) + riskyMethodNameContents.add(name.toLowerCase()); + } } private BugReporter bugReporter; private OpcodeStack stack = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |