[Fb-contrib-commit] SF.net SVN: fb-contrib: [990] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-03-09 03:38:52
|
Revision: 990 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=990&view=rev Author: dbrosius Date: 2008-03-08 19:35:10 -0800 (Sat, 08 Mar 2008) Log Message: ----------- update documentation to note that static methods also may return MRC issues, but at a LOW_PRIORITY Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2008-03-09 03:25:44 UTC (rev 989) +++ trunk/fb-contrib/etc/messages.xml 2008-03-09 03:35:10 UTC (rev 990) @@ -770,7 +770,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant"> <Details> <![CDATA[ - <p>looks for private methods that only return one constant value. Since there is no + <p>looks for private or static methods that only return one constant value. Since there is no chance for derived classes overriding this behavior, the return of a constant value seems dubious.</p> <p>It is a fast detector</p> @@ -2078,7 +2078,7 @@ <LongDescription>private method {1} only returns one constant value</LongDescription> <Details> <![CDATA[ - <p>This private method only returns one constant value. As this method is private, + <p>This private or static method only returns one constant value. As this method is private or static, it's behavior can't be overridden, and thus the return of a constant value seems dubious. Either the method should be changed to return no value, or perhaps another return value was expected to be returned in another code path in this method.</p> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java 2008-03-09 03:25:44 UTC (rev 989) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java 2008-03-09 03:35:10 UTC (rev 990) @@ -75,7 +75,7 @@ returnPC = -1; super.visitCode(obj); if (methodSuspect && (returnConstant != null)) { - BugInstance bi = new BugInstance(this, "MRC_METHOD_RETURNS_CONSTANT", NORMAL_PRIORITY) + BugInstance bi = new BugInstance(this, "MRC_METHOD_RETURNS_CONSTANT", ((aFlags & Constants.ACC_PRIVATE) != 0) ? NORMAL_PRIORITY : LOW_PRIORITY) .addClass(this) .addMethod(this); if (returnPC >= 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |