fb-contrib-commit Mailing List for fb-contrib (Page 23)
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-24 03:49:34
|
Revision: 1291 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1291&view=rev Author: dbrosius Date: 2009-09-24 03:49:25 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add sample for IPNG Added Paths: ----------- trunk/fb-contrib/samples/IPNC_Sample.java Added: trunk/fb-contrib/samples/IPNC_Sample.java =================================================================== --- trunk/fb-contrib/samples/IPNC_Sample.java (rev 0) +++ trunk/fb-contrib/samples/IPNC_Sample.java 2009-09-24 03:49:25 UTC (rev 1291) @@ -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"); + } +} Property changes on: trunk/fb-contrib/samples/IPNC_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 03:48:27
|
Revision: 1290 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1290&view=rev Author: dbrosius Date: 2009-09-24 03:48:21 +0000 (Thu, 24 Sep 2009) Log Message: ----------- add IPNG Added Paths: ----------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.java Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.java 2009-09-24 03:48:21 UTC (rev 1290) @@ -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 InconsistentParameterNameCasing 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 InconsistentParameterNameCasing(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; + } + } +} Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InconsistentParameterNameCasing.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-13 03:43:13
|
Revision: 1289 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1289&view=rev Author: dbrosius Date: 2009-09-13 03:43:06 +0000 (Sun, 13 Sep 2009) Log Message: ----------- add svn spinner Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-13 03:40:29 UTC (rev 1288) +++ trunk/fb-contrib/htdocs/index.html 2009-09-13 03:43:06 UTC (rev 1289) @@ -48,7 +48,12 @@ <a href="bugdescriptions.html">Bug Descriptions</a> <hr/> - <img id="v4_0_0_image" src="flip2.gif" onClick="toggleBlock('svn', 'v4_0_0_image');" align="top"/> + <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;"> + </div> + <hr/> + <img id="v4_0_0_image" src="flip2.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;"> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-13 03:40:37
|
Revision: 1288 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1288&view=rev Author: dbrosius Date: 2009-09-13 03:40:29 +0000 (Sun, 13 Sep 2009) Log Message: ----------- get ready for 4.1.0 development Modified Paths: -------------- trunk/fb-contrib/build.xml Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2009-09-12 23:18:14 UTC (rev 1287) +++ trunk/fb-contrib/build.xml 2009-09-13 03:40:29 UTC (rev 1288) @@ -20,7 +20,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="4.0.0"/> + <property name="fb-contrib.version" value="4.1.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 23:50:34
|
Revision: 1287 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1287&view=rev Author: dbrosius Date: 2009-09-12 23:18:14 +0000 (Sat, 12 Sep 2009) Log Message: ----------- change the text too Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-12 23:17:47 UTC (rev 1286) +++ trunk/fb-contrib/htdocs/index.html 2009-09-12 23:18:14 UTC (rev 1287) @@ -49,7 +49,7 @@ <hr/> <img id="v4_0_0_image" src="flip2.gif" onClick="toggleBlock('svn', 'v4_0_0_image');" align="top"/> - Detectors added in SVN<br/> + Detectors added in v4.0.0<br/> <div id="v4_0_0" style="display:block;"> <ul> <li><b>[TBP] Tristate Boolean Pattern</b><br/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 23:17:58
|
Revision: 1286 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1286&view=rev Author: dbrosius Date: 2009-09-12 23:17:47 +0000 (Sat, 12 Sep 2009) Log Message: ----------- change label to 4.0.0 Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-12 22:56:49 UTC (rev 1285) +++ trunk/fb-contrib/htdocs/index.html 2009-09-12 23:17:47 UTC (rev 1286) @@ -48,9 +48,9 @@ <a href="bugdescriptions.html">Bug Descriptions</a> <hr/> - <img id="svn_image" src="flip2.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> + <img id="v4_0_0_image" src="flip2.gif" onClick="toggleBlock('svn', 'v4_0_0_image');" align="top"/> Detectors added in SVN<br/> - <div id="svn" style="display:block;"> + <div id="v4_0_0" style="display:block;"> <ul> <li><b>[TBP] Tristate Boolean Pattern</b><br/> Looks for methods that are defined to return Boolean, but return null. This thus @@ -501,4 +501,4 @@ </script> </body> -</html> \ No newline at end of file +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 23:13:09
|
Revision: 1284 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1284&view=rev Author: dbrosius Date: 2009-09-12 22:51:08 +0000 (Sat, 12 Sep 2009) Log Message: ----------- move to 4.0.0 Modified Paths: -------------- trunk/fb-contrib/build.xml Modified: trunk/fb-contrib/build.xml =================================================================== --- trunk/fb-contrib/build.xml 2009-09-12 20:44:51 UTC (rev 1283) +++ trunk/fb-contrib/build.xml 2009-09-12 22:51:08 UTC (rev 1284) @@ -20,7 +20,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="3.9.0"/> + <property name="fb-contrib.version" value="4.0.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> @@ -189,4 +189,4 @@ <target name="release" depends="build, check14, srczip, html, javadoc" description="prepares everything for a release"/> -</project> \ No newline at end of file +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 22:57:13
|
Revision: 1285 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1285&view=rev Author: dbrosius Date: 2009-09-12 22:56:49 +0000 (Sat, 12 Sep 2009) Log Message: ----------- tag version 4.0.0 Added Paths: ----------- tags/v4_0_0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 21:13:05
|
Revision: 1282 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1282&view=rev Author: dbrosius Date: 2009-09-12 20:44:15 +0000 (Sat, 12 Sep 2009) Log Message: ----------- Modified Paths: -------------- trunk/fb-contrib/lib/findbugs-ant.jar trunk/fb-contrib/lib/findbugs.jar Modified: trunk/fb-contrib/lib/findbugs-ant.jar =================================================================== (Binary files differ) Modified: trunk/fb-contrib/lib/findbugs.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 20:45:01
|
Revision: 1283 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1283&view=rev Author: dbrosius Date: 2009-09-12 20:44:51 +0000 (Sat, 12 Sep 2009) Log Message: ----------- Modified Paths: -------------- trunk/fb-contrib/lib/jsr305.jar Modified: trunk/fb-contrib/lib/jsr305.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 20:43:22
|
Revision: 1281 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1281&view=rev Author: dbrosius Date: 2009-09-12 20:43:02 +0000 (Sat, 12 Sep 2009) Log Message: ----------- Modified Paths: -------------- trunk/fb-contrib/lib/bcel.jar Modified: trunk/fb-contrib/lib/bcel.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 20:42:21
|
Revision: 1280 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1280&view=rev Author: dbrosius Date: 2009-09-12 20:42:14 +0000 (Sat, 12 Sep 2009) Log Message: ----------- Modified Paths: -------------- trunk/fb-contrib/lib/annotations.jar Modified: trunk/fb-contrib/lib/annotations.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-12 20:38:35
|
Revision: 1279 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1279&view=rev Author: dbrosius Date: 2009-09-12 20:38:22 +0000 (Sat, 12 Sep 2009) Log Message: ----------- update to jars Added Paths: ----------- trunk/fb-contrib/lib/asm-3.1.jar trunk/fb-contrib/lib/asm-tree-3.1.jar trunk/fb-contrib/lib/dom4j-1.6.1.jar Added: trunk/fb-contrib/lib/asm-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/fb-contrib/lib/asm-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/fb-contrib/lib/asm-tree-3.1.jar =================================================================== (Binary files differ) Property changes on: trunk/fb-contrib/lib/asm-tree-3.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/fb-contrib/lib/dom4j-1.6.1.jar =================================================================== (Binary files differ) Property changes on: trunk/fb-contrib/lib/dom4j-1.6.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-08 01:55:02
|
Revision: 1278 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1278&view=rev Author: dbrosius Date: 2009-09-08 01:54:56 +0000 (Tue, 08 Sep 2009) Log Message: ----------- look for arrays of objects as a matching parm Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-08 01:32:29 UTC (rev 1277) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-08 01:54:56 UTC (rev 1278) @@ -139,7 +139,7 @@ for (int t = 0; t < types.length; t++) { Type type = types[t]; String parmSig = type.getSignature(); - if (returnArraySig.equals(parmSig) || "Ljava/lang/Object;".equals(parmSig)) { + if (returnArraySig.equals(parmSig) || "Ljava/lang/Object;".equals(parmSig) || "[Ljava/lang/Object;".equals(parmSig)) { int parmIndex = types.length - t - 1; if (stack.getStackDepth() > parmIndex) { OpcodeStack.Item item = stack.getStackItem(parmIndex); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-08 01:32:40
|
Revision: 1277 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1277&view=rev Author: dbrosius Date: 2009-09-08 01:32:29 +0000 (Tue, 08 Sep 2009) Log Message: ----------- implement INVOKE_STATIC, and don't worry about parm offset for 'this' as this will be below the parms. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-08 01:31:51 UTC (rev 1276) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-08 01:32:29 UTC (rev 1277) @@ -132,14 +132,15 @@ case INVOKEVIRTUAL: case INVOKEINTERFACE: - case INVOKESPECIAL: { - int parmOffset = (seen == INVOKESPECIAL) ? 0 : 1; + case INVOKESPECIAL: + case INVOKESTATIC: { String methodSig = getSigConstantOperand(); Type[] types = Type.getArgumentTypes(methodSig); for (int t = 0; t < types.length; t++) { Type type = types[t]; - if (returnArraySig.equals(type.getSignature())) { - int parmIndex = types.length - t - 1 + parmOffset; + String parmSig = type.getSignature(); + if (returnArraySig.equals(parmSig) || "Ljava/lang/Object;".equals(parmSig)) { + int parmIndex = types.length - t - 1; if (stack.getStackDepth() > parmIndex) { OpcodeStack.Item item = stack.getStackItem(parmIndex); if (item.getUserValue() != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-08 01:31:57
|
Revision: 1276 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1276&view=rev Author: dbrosius Date: 2009-09-08 01:31:51 +0000 (Tue, 08 Sep 2009) Log Message: ----------- more tests Modified Paths: -------------- trunk/fb-contrib/samples/SUA_Sample.java Modified: trunk/fb-contrib/samples/SUA_Sample.java =================================================================== --- trunk/fb-contrib/samples/SUA_Sample.java 2009-09-08 01:13:47 UTC (rev 1275) +++ trunk/fb-contrib/samples/SUA_Sample.java 2009-09-08 01:31:51 UTC (rev 1276) @@ -68,7 +68,7 @@ private void initArray(int[] i) {} - private int[] copy(int[] src) + public int[] copy(int[] src) { int[] dst = new int[src.length]; System.arraycopy(src, 0, dst, 0, src.length); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-08 01:14:02
|
Revision: 1275 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1275&view=rev Author: dbrosius Date: 2009-09-08 01:13:47 +0000 (Tue, 08 Sep 2009) Log Message: ----------- add static call for initializing an array sample Modified Paths: -------------- trunk/fb-contrib/samples/SUA_Sample.java Modified: trunk/fb-contrib/samples/SUA_Sample.java =================================================================== --- trunk/fb-contrib/samples/SUA_Sample.java 2009-09-07 05:04:29 UTC (rev 1274) +++ trunk/fb-contrib/samples/SUA_Sample.java 2009-09-08 01:13:47 UTC (rev 1275) @@ -67,4 +67,11 @@ private void initArray(int[] i) {} + + private int[] copy(int[] src) + { + int[] dst = new int[src.length]; + System.arraycopy(src, 0, dst, 0, src.length); + return dst; + } } \ 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-07 05:04:35
|
Revision: 1274 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1274&view=rev Author: dbrosius Date: 2009-09-07 05:04:29 +0000 (Mon, 07 Sep 2009) Log Message: ----------- document Inappropriate ToString Use Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-07 05:01:30 UTC (rev 1273) +++ trunk/fb-contrib/htdocs/index.html 2009-09-07 05:04:29 UTC (rev 1274) @@ -61,6 +61,11 @@ Looks for creation of arrays, that are not populated before being returned for a method. While it is possible that the method that called this method will do the work of populated the array, it seems odd that this would be the case.</li> + <li><b>[ITU] Inappropriate ToString Use</b><br/> + Looks for methods that rely on the format of the string fetched from another object's toString + method, when that method appears not to be owned by the author of the calling method. + As the implementation of toString() is often considered a private implementation detail of a class, + and not something that should be relied on, depending on it's format is dangerous.</li> <li><b>[BED] Bogus Exception Declaration</b><br/> Looks for constructors, private methods or static methods that declare that they throw specific checked exceptions, but that do not. This just causes callers of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-07 05:01:40
|
Revision: 1273 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1273&view=rev Author: dbrosius Date: 2009-09-07 05:01:30 +0000 (Mon, 07 Sep 2009) Log Message: ----------- document Tristate Boolean Pattern Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-07 04:59:31 UTC (rev 1272) +++ trunk/fb-contrib/htdocs/index.html 2009-09-07 05:01:30 UTC (rev 1273) @@ -52,6 +52,11 @@ Detectors added in SVN<br/> <div id="svn" style="display:block;"> <ul> + <li><b>[TBP] Tristate Boolean Pattern</b><br/> + Looks for methods that are defined to return Boolean, but return null. This thus + allows three return values, Boolean.FALSE, Boolean.TRUE and null. If three values are + intended, it would be more clear to just create an enumeration with three values + and return that type.</li> <li><b>[SUA] Suspicious Uninitialized Array</b><br/> Looks for creation of arrays, that are not populated before being returned for a method. While it is possible that the method that called this method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-07 04:59:43
|
Revision: 1272 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1272&view=rev Author: dbrosius Date: 2009-09-07 04:59:31 +0000 (Mon, 07 Sep 2009) Log Message: ----------- make SMA_STUTTERED_METHOD_ARGUMENTS hidden for now Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-07 04:47:40 UTC (rev 1271) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-07 04:59:31 UTC (rev 1272) @@ -346,7 +346,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments" speed="fast" - reports="SMA_STUTTERED_METHOD_ARGUMENTS" /> + reports="SMA_STUTTERED_METHOD_ARGUMENTS" + hidden="true" /> <Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern" speed="fast" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-07 04:47:46
|
Revision: 1271 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1271&view=rev Author: dbrosius Date: 2009-09-07 04:47:40 +0000 (Mon, 07 Sep 2009) Log Message: ----------- document SUA Modified Paths: -------------- trunk/fb-contrib/htdocs/index.html Modified: trunk/fb-contrib/htdocs/index.html =================================================================== --- trunk/fb-contrib/htdocs/index.html 2009-09-06 20:45:23 UTC (rev 1270) +++ trunk/fb-contrib/htdocs/index.html 2009-09-07 04:47:40 UTC (rev 1271) @@ -52,6 +52,10 @@ Detectors added in SVN<br/> <div id="svn" style="display:block;"> <ul> + <li><b>[SUA] Suspicious Uninitialized Array</b><br/> + Looks for creation of arrays, that are not populated before being returned + for a method. While it is possible that the method that called this method + will do the work of populated the array, it seems odd that this would be the case.</li> <li><b>[BED] Bogus Exception Declaration</b><br/> Looks for constructors, private methods or static methods that declare that they throw specific checked exceptions, but that do not. This just causes callers of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-06 20:45:29
|
Revision: 1270 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1270&view=rev Author: dbrosius Date: 2009-09-06 20:45:23 +0000 (Sun, 06 Sep 2009) Log Message: ----------- fix case where array is passed as parm to method (ignore that) Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 20:40:26 UTC (rev 1269) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 20:45:23 UTC (rev 1270) @@ -140,7 +140,23 @@ Type type = types[t]; if (returnArraySig.equals(type.getSignature())) { int parmIndex = types.length - t - 1 + parmOffset; - //TODO + if (stack.getStackDepth() > parmIndex) { + OpcodeStack.Item item = stack.getStackItem(parmIndex); + if (item.getUserValue() != null) { + userValue = item.getUserValue(); + int reg; + if (userValue instanceof Integer) { + reg = ((Integer)userValue).intValue(); + } else { + reg = item.getRegisterNumber(); + } + item.setUserValue(null); + if (reg >= 0) { + uninitializedRegs.clear(reg); + } + userValue = null; + } + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-06 20:40:32
|
Revision: 1269 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1269&view=rev Author: dbrosius Date: 2009-09-06 20:40:26 +0000 (Sun, 06 Sep 2009) Log Message: ----------- add fp for when u use a method to init an array Modified Paths: -------------- trunk/fb-contrib/samples/SUA_Sample.java Modified: trunk/fb-contrib/samples/SUA_Sample.java =================================================================== --- trunk/fb-contrib/samples/SUA_Sample.java 2009-09-06 20:39:02 UTC (rev 1268) +++ trunk/fb-contrib/samples/SUA_Sample.java 2009-09-06 20:40:26 UTC (rev 1269) @@ -57,4 +57,14 @@ multi[0][0] = 1.0f; return multi; } + + public int[] useMethodToInitArray() + { + int[] i = new int[3]; + initArray(i); + return i; + } + + private void initArray(int[] i) + {} } \ 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-06 20:39:09
|
Revision: 1268 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1268&view=rev Author: dbrosius Date: 2009-09-06 20:39:02 +0000 (Sun, 06 Sep 2009) Log Message: ----------- unhide SUA Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2009-09-06 20:38:41 UTC (rev 1267) +++ trunk/fb-contrib/etc/findbugs.xml 2009-09-06 20:39:02 UTC (rev 1268) @@ -355,8 +355,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray" speed="fast" - reports="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" - hidden="true" /> + reports="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" /> <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse" speed="fast" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2009-09-06 20:38:48
|
Revision: 1267 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1267&view=rev Author: dbrosius Date: 2009-09-06 20:38:41 +0000 (Sun, 06 Sep 2009) Log Message: ----------- handle storing into sub arrays of a multi array Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 20:29:36 UTC (rev 1266) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-09-06 20:38:41 UTC (rev 1267) @@ -23,6 +23,7 @@ import org.apache.bcel.classfile.Code; import org.apache.bcel.generic.Type; +import com.mebigfatguy.fbcontrib.utils.Integer14; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; import com.mebigfatguy.fbcontrib.utils.SignatureUtils; @@ -98,7 +99,7 @@ */ @Override public void sawOpcode(int seen) { - String userValue = null; + Object userValue = null; try { switch (seen) { case NEWARRAY: { @@ -146,7 +147,12 @@ break; case AALOAD: { - //TODO: + if (stack.getStackDepth() >= 2) { + OpcodeStack.Item item = stack.getStackItem(1); + if (UNINIT_ARRAY.equals(item.getUserValue())) { + userValue = Integer14.valueOf(item.getRegisterNumber()); + } + } } break; @@ -161,11 +167,18 @@ case SASTORE: { if (stack.getStackDepth() >= 3) { OpcodeStack.Item item = stack.getStackItem(2); + userValue = item.getUserValue(); + int reg; + if (userValue instanceof Integer) { + reg = ((Integer)userValue).intValue(); + } else { + reg = item.getRegisterNumber(); + } item.setUserValue(null); - int reg = item.getRegisterNumber(); if (reg >= 0) { uninitializedRegs.clear(reg); } + userValue = null; } } break; @@ -225,7 +238,7 @@ stack.sawOpcode(this, seen); if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); - item.setUserValue(userValue != null ? UNINIT_ARRAY : null); + item.setUserValue(userValue); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |