fb-contrib-commit Mailing List for fb-contrib (Page 22)
Brought to you by:
dbrosius
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(56) |
Oct
(60) |
Nov
(58) |
Dec
(89) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(66) |
Feb
(55) |
Mar
(85) |
Apr
(115) |
May
(35) |
Jun
(28) |
Jul
(3) |
Aug
(48) |
Sep
(37) |
Oct
(22) |
Nov
(14) |
Dec
(66) |
2007 |
Jan
(45) |
Feb
(63) |
Mar
(10) |
Apr
(1) |
May
(1) |
Jun
(12) |
Jul
|
Aug
|
Sep
(25) |
Oct
(21) |
Nov
(39) |
Dec
|
2008 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(5) |
May
(2) |
Jun
(32) |
Jul
(9) |
Aug
(10) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
2009 |
Jan
(10) |
Feb
(31) |
Mar
(32) |
Apr
(35) |
May
(25) |
Jun
|
Jul
(31) |
Aug
(10) |
Sep
(95) |
Oct
(35) |
Nov
(10) |
Dec
(34) |
2010 |
Jan
(90) |
Feb
(4) |
Mar
(7) |
Apr
(20) |
May
(20) |
Jun
(13) |
Jul
(7) |
Aug
(18) |
Sep
(25) |
Oct
(4) |
Nov
(16) |
Dec
(2) |
2011 |
Jan
(1) |
Feb
|
Mar
(11) |
Apr
(3) |
May
(2) |
Jun
(26) |
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(14) |
Nov
(3) |
Dec
(4) |
2013 |
Jan
(3) |
Feb
(2) |
Mar
(1) |
Apr
(4) |
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(3) |
2014 |
Jan
(4) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
(2) |
Nov
(7) |
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(3) |
2018 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(5) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <dbr...@us...> - 2009-09-26 05:19:05
|
Revision: 1316 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1316&view=rev Author: dbrosius Date: 2009-09-26 05:18:56 +0000 (Sat, 26 Sep 2009) Log Message: ----------- guard against npes Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-25 13:13:31 UTC (rev 1315) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-26 05:18:56 UTC (rev 1316) @@ -93,20 +93,23 @@ if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); String parmName = (String)item.getConstant(); - String upperParmName = parmName.toUpperCase(Locale.getDefault()); - Map<String, List<SourceInfo>> parmCaseInfo = parmInfo.get(upperParmName); - if (parmCaseInfo == null) { - parmCaseInfo = new HashMap<String, List<SourceInfo>>(); - parmInfo.put(upperParmName, parmCaseInfo); + if (parmName != null) + { + String upperParmName = parmName.toUpperCase(Locale.getDefault()); + Map<String, List<SourceInfo>> parmCaseInfo = parmInfo.get(upperParmName); + if (parmCaseInfo == null) { + parmCaseInfo = new HashMap<String, List<SourceInfo>>(); + parmInfo.put(upperParmName, parmCaseInfo); + } + + List<SourceInfo> annotations = parmCaseInfo.get(parmName); + if (annotations == null) { + annotations = new ArrayList<SourceInfo>(); + parmCaseInfo.put(parmName, annotations); + } + + annotations.add(new SourceInfo(getClassName(), getMethodName(), getMethodSig(), getMethod().isStatic(), SourceLineAnnotation.fromVisitedInstruction(getClassContext(), this, getPC()))); } - - List<SourceInfo> annotations = parmCaseInfo.get(parmName); - if (annotations == null) { - annotations = new ArrayList<SourceInfo>(); - parmCaseInfo.put(parmName, annotations); - } - - annotations.add(new SourceInfo(getClassName(), getMethodName(), getMethodSig(), getMethod().isStatic(), SourceLineAnnotation.fromVisitedInstruction(getClassContext(), this, getPC()))); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-25 13:13:39
|
Revision: 1315 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1315&view=rev Author: dbrosius Date: 2009-09-25 13:13:31 +0000 (Fri, 25 Sep 2009) Log Message: ----------- expand svn now Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-25 06:22:15 UTC (rev 1314) +++ trunk/fb-contrib/htdocs/index.html 2009-09-25 13:13:31 UTC (rev 1315) @@ -48,9 +48,9 @@ <a href="bugdescriptions.html">Bug Descriptions</a> <hr/> - <img id="svn_image" src="flip1.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> + <img id="svn_image" src="flip2.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> Detectors added in svn<br/> - <div id="svn" style="display:none;"> + <div id="svn" style="display:block;"> <ul> <li><b>[OC] Overzealous Casting</b><br/> Looks for manual casts of objects that are more specific then needed as the value is assigned @@ -62,9 +62,9 @@ </ul> </div> <hr/> - <img id="v4_0_0_image" src="flip2.gif" onClick="toggleBlock('v4_0_0', 'v4_0_0_image');" align="top"/> + <img id="v4_0_0_image" src="flip1.gif" onClick="toggleBlock('v4_0_0', 'v4_0_0_image');" align="top"/> Detectors added in v4.0.0<br/> - <div id="v4_0_0" style="display:block;"> + <div id="v4_0_0" style="display:none;"> <ul> <li><b>[TBP] Tristate Boolean Pattern</b><br/> Looks for methods that are defined to return Boolean, but return null. This thus This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-25 06:22:22
|
Revision: 1314 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1314&view=rev Author: dbrosius Date: 2009-09-25 06:22:15 +0000 (Fri, 25 Sep 2009) Log Message: ----------- document goofiness Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-25 06:10:29 UTC (rev 1313) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-25 06:22:15 UTC (rev 1314) @@ -95,6 +95,7 @@ castClass = getClassConstantOperand(); state = SAW_CHECKCAST; } else if (seen == INVOKEINTERFACE) { + //enhanced for loops add an incorrect checkcast instruction, so ignore checkcasts after iterator.next() String clsName = getClassConstantOperand(); String methodName = getNameConstantOperand(); if ("java/util/Iterator".equals(clsName) && "next".equals(methodName)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-25 06:10:41
|
Revision: 1313 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1313&view=rev Author: dbrosius Date: 2009-09-25 06:10:29 +0000 (Fri, 25 Sep 2009) Log Message: ----------- enhanced for loops generate the wrong checkcast code, so just ignore that case. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-25 04:57:32 UTC (rev 1312) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-25 06:10:29 UTC (rev 1313) @@ -43,7 +43,8 @@ extends BytecodeScanningDetector { public static final int SAW_NOTHING = 0; - public static final int SAW_CHECKCAST = 1; + public static final int SAW_NEXT = 1; + public static final int SAW_CHECKCAST = 2; BugReporter bugReporter; int state; @@ -93,9 +94,19 @@ if (seen == CHECKCAST) { castClass = getClassConstantOperand(); state = SAW_CHECKCAST; + } else if (seen == INVOKEINTERFACE) { + String clsName = getClassConstantOperand(); + String methodName = getNameConstantOperand(); + if ("java/util/Iterator".equals(clsName) && "next".equals(methodName)) { + state = SAW_NEXT; + } } break; + case SAW_NEXT: + state = SAW_NOTHING; + break; + case SAW_CHECKCAST: if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { int reg = RegisterUtils.getAStoreReg(this, seen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-25 04:57:42
|
Revision: 1312 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1312&view=rev Author: dbrosius Date: 2009-09-25 04:57:32 +0000 (Fri, 25 Sep 2009) Log Message: ----------- engrish Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 06:19:42 UTC (rev 1311) +++ trunk/fb-contrib/etc/messages.xml 2009-09-25 04:57:32 UTC (rev 1312) @@ -1006,9 +1006,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing"> <Details> <![CDATA[ - <p>looks for methods that use parameter names to access objects in HttpRequest Parameters - but uses the same name with different casing. As these parameter names are case sensitive - this will lead to confusion.</p> + <p>looks for methods that use the same name with different casing to access objects in HttpRequest Parameters. + As these parameter names are case sensitive this will lead to confusion.</p> <p>It is a fast detector</p> ]]> </Details> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:19:49
|
Revision: 1311 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1311&view=rev Author: dbrosius Date: 2009-09-24 06:19:42 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add OC Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-24 06:18:28 UTC (rev 1310) +++ trunk/fb-contrib/htdocs/index.html 2009-09-24 06:19:42 UTC (rev 1311) @@ -52,6 +52,10 @@ Detectors added in svn<br/> <div id="svn" style="display:none;"> <ul> + <li><b>[OC] Overzealous Casting</b><br/> + Looks for manual casts of objects that are more specific then needed as the value is assigned + to a class or interface higher up in the inheritance chain. You only need to cast to that class + or interface.</li> <li><b>[IKNC] Inconsistent Key Name Casing</b><br/> Looks for calls to HttpRequest.getParameter with parameters of the same name with different cases like 'id' and 'Id'.</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:18:36
|
Revision: 1310 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1310&view=rev Author: dbrosius Date: 2009-09-24 06:18:28 +0000 (Thu, 24 Sep 2009) Log Message: ----------- support PUTFIELD Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-24 06:10:34 UTC (rev 1309) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-24 06:18:28 UTC (rev 1310) @@ -22,6 +22,7 @@ import org.apache.bcel.Constants; import org.apache.bcel.classfile.Code; +import org.apache.bcel.classfile.Field; import org.apache.bcel.classfile.LocalVariable; import org.apache.bcel.classfile.LocalVariableTable; import org.apache.bcel.classfile.Method; @@ -31,6 +32,7 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; +import edu.umd.cs.findbugs.FieldAnnotation; /** * looks for manual casts of objects that are more specific then needed as the value is assigned @@ -111,7 +113,17 @@ } } } else if (seen == PUTFIELD) { - + FieldAnnotation f = FieldAnnotation.fromReferencedField(this); + String sig = f.getFieldSignature(); + if (sig.charAt(0) == 'L') { + sig = sig.substring(1, sig.length() - 1); + } + if (!sig.equals(castClass)) { + bugReporter.reportBug(new BugInstance(this, "OC_OVERZEALOUS_CASTING", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } } state = SAW_NOTHING; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:10:50
|
Revision: 1309 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1309&view=rev Author: dbrosius Date: 2009-09-24 06:10:34 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add OC detector Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 06:10:13 UTC (rev 1308) +++ trunk/fb-contrib/etc/messages.xml 2009-09-24 06:10:34 UTC (rev 1309) @@ -1013,6 +1013,17 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.OverzealousCasting"> + <Details> + <![CDATA[ + <p>looks for manual casts of objects that are more specific then needed as the value is assigned + to a class or interface higher up in the inheritance chain. You only need to cast to that class + or interface.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> @@ -2634,6 +2645,18 @@ </Details> </BugPattern> + <BugPattern type="OC_OVERZEALOUS_CASTING"> + <ShortDescription>method manually casts the right hand side of an assignment more specifically than needed</ShortDescription> + <LongDescription>method {1} manually casts the right hand side of an assignment more specifically than needed</LongDescription> + <Details> + <![CDATA[ + <p>This method casts the right hand side of an expression to a class that is more specific than the + variable on the left hand side of the assignment. The cast only has to be as specific as what the variable + that is on the left. Using a more specific type on the right hand side just increases cohesion. + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -2719,4 +2742,5 @@ <BugCode abbrev="SUA">SuspiciousUninitializedArray</BugCode> <BugCode abbrev="ITU">Inappropriate ToString Use</BugCode> <BugCode abbrev="IKNC">Inconsistent Key Name Casing</BugCode> + <BugCode abbrev="OC">Overzealous Casting</BugCode> </MessageCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:10:19
|
Revision: 1308 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1308&view=rev Author: dbrosius Date: 2009-09-24 06:10:13 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add OC detector Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-24 06:09:56 UTC (rev 1307) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-24 06:10:13 UTC (rev 1308) @@ -365,6 +365,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing" speed="fast" reports="IKNC_INCONSISTENT_HTTP_PARAM_CASING" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.OverzealousCasting" + speed="fast" + reports="OC_OVERZEALOUS_CASTING" /> <!-- BugPattern --> @@ -491,4 +495,5 @@ <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" /> <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> + <BugPattern abbrev="OC" type="OC_OVERZEALOUS_CASTING" category="CORRECTNESS" experimental="true" /> </FindbugsPlugin> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:10:02
|
Revision: 1307 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1307&view=rev Author: dbrosius Date: 2009-09-24 06:09:56 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add OC detector Added Paths: ----------- trunk/fb-contrib/samples/OC_Sample.java Added: trunk/fb-contrib/samples/OC_Sample.java =================================================================== --- trunk/fb-contrib/samples/OC_Sample.java (rev 0) +++ trunk/fb-contrib/samples/OC_Sample.java 2009-09-24 06:09:56 UTC (rev 1307) @@ -0,0 +1,10 @@ +import java.util.Collection; +import java.util.ArrayList; + +public class OC_Sample +{ + public void castList(Object o) + { + Collection<String> c = (ArrayList<String>)o; + } +} \ No newline at end of file Property changes on: trunk/fb-contrib/samples/OC_Sample.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 06:09:14
|
Revision: 1306 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1306&view=rev Author: dbrosius Date: 2009-09-24 06:09:07 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add OC detector Added Paths: ----------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java 2009-09-24 06:09:07 UTC (rev 1306) @@ -0,0 +1,124 @@ +/* + * fb-contrib - Auxiliary detectors for Java programs + * Copyright (C) 2005-2009 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.fbcontrib.detect; + +import java.util.BitSet; + +import org.apache.bcel.Constants; +import org.apache.bcel.classfile.Code; +import org.apache.bcel.classfile.LocalVariable; +import org.apache.bcel.classfile.LocalVariableTable; +import org.apache.bcel.classfile.Method; + +import com.mebigfatguy.fbcontrib.utils.RegisterUtils; + +import edu.umd.cs.findbugs.BugInstance; +import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.BytecodeScanningDetector; + +/** + * looks for manual casts of objects that are more specific then needed as the value is assigned + * to a class or interface higher up in the inheritance chain. You only need to cast to that class + * or interface. + */ +public class OverzealousCasting + extends BytecodeScanningDetector +{ + public static final int SAW_NOTHING = 0; + public static final int SAW_CHECKCAST = 1; + + BugReporter bugReporter; + int state; + LocalVariableTable lvt; + String castClass; + + /** + * constructs a OC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ + public OverzealousCasting(BugReporter bugReporter) { + this.bugReporter = bugReporter; + } + + /** + * implements the visitor to set the state on entry of the code block to SAW_NOTHING, + * and to see if there is a local variable table + * @param obj the context object of the currently parsed code block + */ + public void visitCode(Code obj) { + state = SAW_NOTHING; + lvt = obj.getLocalVariableTable(); + if (lvt != null && prescreen(getMethod())) + super.visitCode(obj); + } + + /** + * looks for methods that contain a checkcast instruction + * + * @param code the context object of the current code block + * @param method the context object of the current method + * @return if the class does checkcast instructions + */ + public boolean prescreen(Method method) { + BitSet bytecodeSet = getClassContext().getBytecodeSet(method); + return (bytecodeSet != null) && (bytecodeSet.get(Constants.CHECKCAST)); + } + + /** + * implements the visitor to look for a checkcast followed by a astore, where the + * types of the objects are different. + * @param seen the opcode of the currently parsed instruction + */ + public void sawOpcode(int seen) { + switch (state) { + case SAW_NOTHING: + if (seen == CHECKCAST) { + castClass = getClassConstantOperand(); + state = SAW_CHECKCAST; + } + break; + + case SAW_CHECKCAST: + if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { + int reg = RegisterUtils.getAStoreReg(this, seen); + LocalVariable lv = lvt.getLocalVariable(reg, getNextPC()); + if (lv != null) { + String sig = lv.getSignature(); + if (sig.charAt(0) == 'L') { + sig = sig.substring(1, sig.length() - 1); + } + if (!sig.equals(castClass)) { + bugReporter.reportBug(new BugInstance(this, "OC_OVERZEALOUS_CASTING", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + } + } else if (seen == PUTFIELD) { + + } + state = SAW_NOTHING; + break; + + default: + state = SAW_NOTHING; + break; + } + } +} Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverzealousCasting.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 05:22:32
|
Revision: 1305 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1305&view=rev Author: dbrosius Date: 2009-09-24 05:22:24 +0000 (Thu, 24 Sep 2009) Log Message: ----------- javadoc Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-24 05:05:07 UTC (rev 1304) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-24 05:22:24 UTC (rev 1305) @@ -46,10 +46,18 @@ OpcodeStack stack; Map<String, Map<String, List<SourceInfo>>> parmInfo = new HashMap<String, Map<String, List<SourceInfo>>>(); + /** + * constructs a IKNC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public InconsistentKeyNameCasing(BugReporter reporter) { bugReporter = reporter; } + /** + * implements the visitor to create the opcode stack + * @param classContext the context object of the currently parsed class + */ public void visitClassContext(ClassContext classContext) { try { stack = new OpcodeStack(); @@ -59,11 +67,20 @@ } } + /** + * implements the visitor to reset the opcode stack for a new method + * @param obj the context object of the currently parsed code block + */ public void visitCode(Code obj) { stack.resetForMethodEntry(this); super.visitCode(obj); } + /** + * implements the visitor to look for calls to HttpServletRequest.getParameter + * and collect what the name of the key is. + * @param seen the opcode of the currently parsed instruction + */ public void sawOpcode(int seen) { try { if (seen == INVOKEINTERFACE) { @@ -100,6 +117,10 @@ } } + /** + * implements the visitor to look for the collected parm names, and look for duplicates that are + * different in casing only. + */ @Override public void report() { for (Map<String, List<SourceInfo>> parmCaseInfo : parmInfo.values()) { @@ -121,6 +142,9 @@ parmInfo.clear(); } + /** + * a holder for location information of a getParameter call + */ static class SourceInfo { String clsName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 05:05:16
|
Revision: 1304 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1304&view=rev Author: dbrosius Date: 2009-09-24 05:05:07 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename, ai karumba Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-24 05:04:50 UTC (rev 1303) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-24 05:05:07 UTC (rev 1304) @@ -490,5 +490,5 @@ <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" /> <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" /> <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> - <BugPattern abbrev="IKNG" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> + <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 05:04:57
|
Revision: 1303 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1303&view=rev Author: dbrosius Date: 2009-09-24 05:04:50 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename, ai karumba Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 05:02:13 UTC (rev 1302) +++ trunk/fb-contrib/etc/messages.xml 2009-09-24 05:04:50 UTC (rev 1303) @@ -2718,5 +2718,5 @@ <BugCode abbrev="TBP">Tristate Boolean Pattern</BugCode> <BugCode abbrev="SUA">SuspiciousUninitializedArray</BugCode> <BugCode abbrev="ITU">Inappropriate ToString Use</BugCode> - <BugCode abbrev="IKNG">Inconsistent Key Name Casing</BugCode> + <BugCode abbrev="IKNC">Inconsistent Key Name Casing</BugCode> </MessageCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 05:02:19
|
Revision: 1302 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1302&view=rev Author: dbrosius Date: 2009-09-24 05:02:13 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 05:01:14 UTC (rev 1301) +++ trunk/fb-contrib/etc/messages.xml 2009-09-24 05:02:13 UTC (rev 1302) @@ -1003,7 +1003,7 @@ </Details> </Detector> - <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentParameterNameCasing"> + <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing"> <Details> <![CDATA[ <p>looks for methods that use parameter names to access objects in HttpRequest Parameters This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 05:01:25
|
Revision: 1301 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1301&view=rev Author: dbrosius Date: 2009-09-24 05:01:14 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-24 04:59:11 UTC (rev 1300) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-24 05:01:14 UTC (rev 1301) @@ -362,7 +362,7 @@ speed="fast" reports="ITU_INAPPROPRIATE_TOSTRING_USE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentParameterNameCasing" + <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing" speed="fast" reports="IKNC_INCONSISTENT_HTTP_PARAM_CASING" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:59:26
|
Revision: 1300 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1300&view=rev Author: dbrosius Date: 2009-09-24 04:59:11 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/samples/IKNC_Sample.java Modified: trunk/fb-contrib/samples/IKNC_Sample.java =================================================================== --- trunk/fb-contrib/samples/IKNC_Sample.java 2009-09-24 04:58:07 UTC (rev 1299) +++ trunk/fb-contrib/samples/IKNC_Sample.java 2009-09-24 04:59:11 UTC (rev 1300) @@ -2,7 +2,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -public class IPNC_Sample +public class IKNC_Sample { public void doGet(HttpServletRequest req, HttpServletResponse resp) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:58:15
|
Revision: 1299 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1299&view=rev Author: dbrosius Date: 2009-09-24 04:58:07 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-24 04:57:27 UTC (rev 1298) +++ trunk/fb-contrib/htdocs/index.html 2009-09-24 04:58:07 UTC (rev 1299) @@ -51,6 +51,11 @@ <img id="svn_image" src="flip1.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> Detectors added in svn<br/> <div id="svn" style="display:none;"> + <ul> + <li><b>[IKNC] Inconsistent Key Name Casing</b><br/> + Looks for calls to HttpRequest.getParameter with parameters of the same + name with different cases like 'id' and 'Id'.</li> + </ul> </div> <hr/> <img id="v4_0_0_image" src="flip2.gif" onClick="toggleBlock('v4_0_0', 'v4_0_0_image');" align="top"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:57:34
|
Revision: 1298 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1298&view=rev Author: dbrosius Date: 2009-09-24 04:57:27 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 04:56:34 UTC (rev 1297) +++ trunk/fb-contrib/etc/messages.xml 2009-09-24 04:57:27 UTC (rev 1298) @@ -2623,7 +2623,7 @@ </Details> </BugPattern> - <BugPattern type="IPNC_INCONSISTENT_HTTP_PARAM_CASING"> + <BugPattern type="IKNC_INCONSISTENT_HTTP_PARAM_CASING"> <ShortDescription>method uses the same HttpRequestRequest parameter name but with different casing</ShortDescription> <LongDescription>method {1} uses the same HttpRequestRequest parameter name but with different casing</LongDescription> <Details> @@ -2718,5 +2718,5 @@ <BugCode abbrev="TBP">Tristate Boolean Pattern</BugCode> <BugCode abbrev="SUA">SuspiciousUninitializedArray</BugCode> <BugCode abbrev="ITU">Inappropriate ToString Use</BugCode> - <BugCode abbrev="IPNG">Inconsistent Parameter Name Casing</BugCode> + <BugCode abbrev="IKNG">Inconsistent Key Name Casing</BugCode> </MessageCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:56:40
|
Revision: 1297 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1297&view=rev Author: dbrosius Date: 2009-09-24 04:56:34 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-24 04:53:55 UTC (rev 1296) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-24 04:56:34 UTC (rev 1297) @@ -364,7 +364,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentParameterNameCasing" speed="fast" - reports="IPNC_INCONSISTENT_HTTP_PARAM_CASING" /> + reports="IKNC_INCONSISTENT_HTTP_PARAM_CASING" /> <!-- BugPattern --> @@ -490,5 +490,5 @@ <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" /> <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" /> <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> - <BugPattern abbrev="IPNG" type="IPNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> + <BugPattern abbrev="IKNG" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:54:01
|
Revision: 1296 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1296&view=rev Author: dbrosius Date: 2009-09-24 04:53:55 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename to IKNC Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-24 04:52:34 UTC (rev 1295) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-24 04:53:55 UTC (rev 1296) @@ -104,7 +104,7 @@ public void report() { for (Map<String, List<SourceInfo>> parmCaseInfo : parmInfo.values()) { if (parmCaseInfo.size() > 1) { - BugInstance bi = new BugInstance(this, "IPNC_INCONSISTENT_HTTP_PARAM_CASING", NORMAL_PRIORITY); + BugInstance bi = new BugInstance(this, "IKNC_INCONSISTENT_HTTP_PARAM_CASING", NORMAL_PRIORITY); for (Map.Entry<String, List<SourceInfo>> sourceInfos :parmCaseInfo.entrySet()) { for (SourceInfo sourceInfo : sourceInfos.getValue()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:52:47
|
Revision: 1295 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1295&view=rev Author: dbrosius Date: 2009-09-24 04:52:34 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename to more sensible Added Paths: ----------- trunk/fb-contrib/samples/IKNC_Sample.java Copied: trunk/fb-contrib/samples/IKNC_Sample.java (from rev 1291, trunk/fb-contrib/samples/IPNC_Sample.java) =================================================================== --- trunk/fb-contrib/samples/IKNC_Sample.java (rev 0) +++ trunk/fb-contrib/samples/IKNC_Sample.java 2009-09-24 04:52:34 UTC (rev 1295) @@ -0,0 +1,16 @@ + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class IPNC_Sample +{ + public void doGet(HttpServletRequest req, HttpServletResponse resp) + { + String id = req.getParameter("id"); + } + + public void doPost(HttpServletRequest req, HttpServletResponse resp) + { + String id = req.getParameter("ID"); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 04:51:01
|
Revision: 1294 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1294&view=rev Author: dbrosius Date: 2009-09-24 04:50:52 +0000 (Thu, 24 Sep 2009) Log Message: ----------- rename to more sensible Added Paths: ----------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java Copied: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java (from rev 1290, trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.java) =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentKeyNameCasing.java 2009-09-24 04:50:52 UTC (rev 1294) @@ -0,0 +1,140 @@ +/* + * fb-contrib - Auxiliary detectors for Java programs + * Copyright (C) 2005-2009 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package com.mebigfatguy.fbcontrib.detect; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.bcel.classfile.Code; + +import edu.umd.cs.findbugs.BugInstance; +import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.BytecodeScanningDetector; +import edu.umd.cs.findbugs.OpcodeStack; +import edu.umd.cs.findbugs.SourceLineAnnotation; +import edu.umd.cs.findbugs.ba.ClassContext; + +/** + * looks for calls to HttpRequest.getParameter with parameters of the same + * name with different cases like 'id' and 'Id'. + */ +public class InconsistentKeyNameCasing extends BytecodeScanningDetector +{ + private static final String HTTP_SERVLET_REQUEST = "javax/servlet/http/HttpServletRequest"; + private static final String GET_PARAMETER = "getParameter"; + private static final String GET_PARAMETER_SIG = "(Ljava/lang/String;)Ljava/lang/String;"; + BugReporter bugReporter; + OpcodeStack stack; + Map<String, Map<String, List<SourceInfo>>> parmInfo = new HashMap<String, Map<String, List<SourceInfo>>>(); + + public InconsistentKeyNameCasing(BugReporter reporter) { + bugReporter = reporter; + } + + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + stack = null; + } + } + + public void visitCode(Code obj) { + stack.resetForMethodEntry(this); + super.visitCode(obj); + } + + public void sawOpcode(int seen) { + try { + if (seen == INVOKEINTERFACE) { + String clsName = getClassConstantOperand(); + if (HTTP_SERVLET_REQUEST.equals(clsName)) { + String methodName = getNameConstantOperand(); + if (GET_PARAMETER.equals(methodName)) { + String signature = getSigConstantOperand(); + if (GET_PARAMETER_SIG.equals(signature)) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + String parmName = (String)item.getConstant(); + String upperParmName = parmName.toUpperCase(Locale.getDefault()); + Map<String, List<SourceInfo>> parmCaseInfo = parmInfo.get(upperParmName); + if (parmCaseInfo == null) { + parmCaseInfo = new HashMap<String, List<SourceInfo>>(); + parmInfo.put(upperParmName, parmCaseInfo); + } + + List<SourceInfo> annotations = parmCaseInfo.get(parmName); + if (annotations == null) { + annotations = new ArrayList<SourceInfo>(); + parmCaseInfo.put(parmName, annotations); + } + + annotations.add(new SourceInfo(getClassName(), getMethodName(), getMethodSig(), getMethod().isStatic(), SourceLineAnnotation.fromVisitedInstruction(getClassContext(), this, getPC()))); + } + } + } + } + } + } finally { + stack.sawOpcode(this, seen); + } + } + + @Override + public void report() { + for (Map<String, List<SourceInfo>> parmCaseInfo : parmInfo.values()) { + if (parmCaseInfo.size() > 1) { + BugInstance bi = new BugInstance(this, "IPNC_INCONSISTENT_HTTP_PARAM_CASING", NORMAL_PRIORITY); + + for (Map.Entry<String, List<SourceInfo>> sourceInfos :parmCaseInfo.entrySet()) { + for (SourceInfo sourceInfo : sourceInfos.getValue()) { + bi.addClass(sourceInfo.clsName); + bi.addMethod(sourceInfo.clsName, sourceInfo.methodName, sourceInfo.signature, sourceInfo.isStatic); + bi.addSourceLine(sourceInfo.srcLine); + bi.addString(sourceInfos.getKey()); + } + } + + bugReporter.reportBug(bi); + } + } + parmInfo.clear(); + } + + static class SourceInfo + { + String clsName; + String methodName; + String signature; + boolean isStatic; + SourceLineAnnotation srcLine; + + public SourceInfo(String cls, String method, String sig, boolean mStatic, SourceLineAnnotation annotation) { + clsName = cls; + methodName = method; + signature = sig; + isStatic = mStatic; + srcLine = annotation; + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 03:50:07
|
Revision: 1293 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1293&view=rev Author: dbrosius Date: 2009-09-24 03:49:58 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add IPNG Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2009-09-24 03:49:42 UTC (rev 1292) +++ trunk/fb-contrib/etc/messages.xml 2009-09-24 03:49:58 UTC (rev 1293) @@ -958,7 +958,7 @@ </Detector> <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments"> - <Details> + <Details> experimental="true" <![CDATA[ <p>looks for method calls that pass the same value for two separate parameters, where those arguments are not constants. Often this is a cut/paste mistake, but if not, it is @@ -1002,6 +1002,17 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentParameterNameCasing"> + <Details> + <![CDATA[ + <p>looks for methods that use parameter names to access objects in HttpRequest Parameters + but uses the same name with different casing. As these parameter names are case sensitive + this will lead to confusion.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> @@ -2612,6 +2623,17 @@ </Details> </BugPattern> + <BugPattern type="IPNC_INCONSISTENT_HTTP_PARAM_CASING"> + <ShortDescription>method uses the same HttpRequestRequest parameter name but with different casing</ShortDescription> + <LongDescription>method {1} uses the same HttpRequestRequest parameter name but with different casing</LongDescription> + <Details> + <![CDATA[ + <p>This method fetches an HttpServletRequest parameter with a parmeter name that was used in other locations + but with a different casing. As HttpServletRequest parameters are case sensitive, this will be very confusing. + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -2696,4 +2718,5 @@ <BugCode abbrev="TBP">Tristate Boolean Pattern</BugCode> <BugCode abbrev="SUA">SuspiciousUninitializedArray</BugCode> <BugCode abbrev="ITU">Inappropriate ToString Use</BugCode> + <BugCode abbrev="IPNG">Inconsistent Parameter Name Casing</BugCode> </MessageCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-24 03:49:50
|
Revision: 1292 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1292&view=rev Author: dbrosius Date: 2009-09-24 03:49:42 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add IPNG Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-24 03:49:25 UTC (rev 1291) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-24 03:49:42 UTC (rev 1292) @@ -361,6 +361,10 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse" speed="fast" reports="ITU_INAPPROPRIATE_TOSTRING_USE" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentParameterNameCasing" + speed="fast" + reports="IPNC_INCONSISTENT_HTTP_PARAM_CASING" /> <!-- BugPattern --> @@ -479,11 +483,12 @@ <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_PARAMETER" category="CORRECTNESS" /> <BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" /> <BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" /> - <BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="UNNC" type="UNNC_UNNECESSARY_NEW_NULL_CHECK" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="DTEP" type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" category="STYLE" experimental="true" /> - <BugPattern abbrev="SMA" type="SMA_STUTTERED_METHOD_ARGUMENTS" category="STYLE" experimental="true" /> - <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" experimental="true" /> - <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" /> + <BugPattern abbrev="UNNC" type="UNNC_UNNECESSARY_NEW_NULL_CHECK" category="CORRECTNESS" /> + <BugPattern abbrev="DTEP" type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" category="STYLE" /> + <BugPattern abbrev="SMA" type="SMA_STUTTERED_METHOD_ARGUMENTS" category="STYLE" /> + <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" /> + <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" /> + <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> + <BugPattern abbrev="IPNG" type="IPNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |