fb-contrib-commit Mailing List for fb-contrib (Page 72)
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: Dave B. <dbr...@us...> - 2005-11-05 01:54:38
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25078/src/com/mebigfatguy/fbcontrib/detect Modified Files: ListIndexedIterating.java Log Message: fix [ 1348346 ] IllegalStateException Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ListIndexedIterating.java 18 Oct 2005 04:06:46 -0000 1.7 +++ ListIndexedIterating.java 5 Nov 2005 01:54:27 -0000 1.8 @@ -187,9 +187,11 @@ Integer initValue = (Integer)itm.getConstant(); if ((initValue == null) || (initValue.intValue() != 0)) it.remove(); - itm = stack.getStackItem(1); - if (fl.isSecondItem(itm)) - it.remove(); + else { + itm = stack.getStackItem(1); + if (fl.isSecondItem(itm)) + it.remove(); + } } fl.setLoopRegLoaded(false); } |
|
From: Dave B. <dbr...@us...> - 2005-11-04 04:32:21
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15853/etc Modified Files: findbugs.xml Log Message: unhide the new detectors Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- findbugs.xml 4 Nov 2005 02:27:59 -0000 1.32 +++ findbugs.xml 4 Nov 2005 04:32:14 -0000 1.33 @@ -80,13 +80,11 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" speed="fast" - reports="NCMU_NON_COLLECTION_METHOD_USE" - hidden="true" /> + reports="NCMU_NON_COLLECTION_METHOD_USE" /> <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading" speed="fast" - reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" - hidden="true" /> + reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" /> <!-- BugPattern --> |
|
From: Dave B. <dbr...@us...> - 2005-11-04 04:31:54
|
Update of /cvsroot/fb-contrib/fb-contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15804 Modified Files: build.xml Log Message: go back to 1.5.0 development Index: build.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- build.xml 4 Nov 2005 02:23:53 -0000 1.13 +++ build.xml 4 Nov 2005 04:31:46 -0000 1.14 @@ -17,7 +17,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="1.4.1"/> + <property name="fb-contrib.version" value="1.5.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> |
|
From: Dave B. <dbr...@us...> - 2005-11-04 02:28:07
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28089/etc Modified Files: findbugs.xml Log Message: hide the two "in-testing' detectors from the bug fix release Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- findbugs.xml 2 Nov 2005 06:07:00 -0000 1.31 +++ findbugs.xml 4 Nov 2005 02:27:59 -0000 1.32 @@ -78,9 +78,15 @@ speed="fast" reports="FPL_FLOATING_POINT_LOOPS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" + speed="fast" + reports="NCMU_NON_COLLECTION_METHOD_USE" + hidden="true" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading" speed="fast" - reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" /> + reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" + hidden="true" /> <!-- BugPattern --> |
|
From: Dave B. <dbr...@us...> - 2005-11-04 02:24:02
|
Update of /cvsroot/fb-contrib/fb-contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27599 Modified Files: build.xml Log Message: prepare for a 1.4.1 release Index: build.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- build.xml 30 Oct 2005 00:26:09 -0000 1.12 +++ build.xml 4 Nov 2005 02:23:53 -0000 1.13 @@ -17,7 +17,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="1.5.0"/> + <property name="fb-contrib.version" value="1.4.1"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> |
|
From: Dave B. <dbr...@us...> - 2005-11-04 02:20:48
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27135/src/com/mebigfatguy/fbcontrib/detect Modified Files: FloatingPointLoops.java Log Message: imported the wrong Type.java Index: FloatingPointLoops.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FloatingPointLoops.java 29 Oct 2005 19:39:14 -0000 1.1 +++ FloatingPointLoops.java 4 Nov 2005 02:20:37 -0000 1.2 @@ -18,14 +18,12 @@ */ package com.mebigfatguy.fbcontrib.detect; -import java.sql.Types; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import org.apache.bcel.classfile.Method; - -import com.sun.org.apache.bcel.internal.generic.Type; +import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; |
|
From: Dave B. <dbr...@us...> - 2005-11-03 05:19:16
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6893/src/com/mebigfatguy/fbcontrib/detect Modified Files: ConfusingAutoboxedOverloading.java Log Message: if a method signature is only different in return type, don't report it for CAO Index: ConfusingAutoboxedOverloading.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ConfusingAutoboxedOverloading.java 2 Nov 2005 06:07:01 -0000 1.1 +++ ConfusingAutoboxedOverloading.java 3 Nov 2005 05:19:08 -0000 1.2 @@ -45,7 +45,7 @@ primitiveSigs.add("I"); primitiveSigs.add("J"); primitiveSigs.add("D"); - primitiveSigs.add("F"); + primitiveSigs.add("F"); } private BugReporter bugReporter; @@ -95,6 +95,7 @@ if (type1.length != type2.length) return false; + boolean foundParmDiff = false; for (int i = 0; i < type1.length; i++) { Type t1 = type1[i]; Type t2 = type2[i]; @@ -108,10 +109,11 @@ return false; } else return false; + foundParmDiff = true; } } - return true; + return foundParmDiff; } private void populateMethodInfo(JavaClass cls, Map<String, Set<String>> methodInfo) { |
|
From: Dave B. <dbr...@us...> - 2005-11-03 03:21:10
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22506/src/com/mebigfatguy/fbcontrib/detect Removed Files: ConfusingAutoboxedOverriding.java Log Message: --- ConfusingAutoboxedOverriding.java DELETED --- |
|
From: Dave B. <dbr...@us...> - 2005-11-03 03:20:21
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22374/src/com/mebigfatguy/fbcontrib/detect Modified Files: OverlyConcreteParameter.java Log Message: for static methods, report the correct parameter number Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- OverlyConcreteParameter.java 1 Nov 2005 04:29:49 -0000 1.22 +++ OverlyConcreteParameter.java 3 Nov 2005 03:20:12 -0000 1.23 @@ -198,7 +198,7 @@ .addClass(this) .addMethod(this) .addSourceLine(this, 0) - .addString("Parameter [" + reg.intValue() + "] " + name + " implements " + infName)); + .addString("Parameter [" + parm + "] " + name + " implements " + infName)); } } } |
|
From: Dave B. <dbr...@us...> - 2005-11-02 06:14:03
|
Update of /cvsroot/fb-contrib/fb-contrib/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5376/htdocs Modified Files: index.html Log Message: doc CAO Index: index.html =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/htdocs/index.html,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- index.html 1 Nov 2005 06:00:44 -0000 1.21 +++ index.html 2 Nov 2005 06:13:55 -0000 1.22 @@ -21,7 +21,12 @@ <li><b>Non Collections Method Use</b><br/> Finds calls to collections objects using methods that are not defined in the Collections interfaces, but that have equivalent methods defined in such. By using the new methods, it allows for the - replacement of concrete classes with interfaces, and simplifies changing collection types if desired.</li> + replacement of concrete classes with interfaces, and simplifies changing collection types if + desired.</li> + <li><b>Confusing Autoboxed Overloading</b><br/> + Finds classes that define overloaded methods where the only difference is a parameter being + of type java.lang.Character, and int, long, float or double. Due to autoboxing, one might conclude + that a parameter of 'a' would autobox to Character, but would instead be cast to a double.</li> </ul> <hr/> Detectors added in v1.4.0<br/> |
|
From: Dave B. <dbr...@us...> - 2005-11-02 06:07:13
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4578/src/com/mebigfatguy/fbcontrib/detect Added Files: ConfusingAutoboxedOverloading.java Log Message: new detector CAO - intial checkin --- NEW FILE: ConfusingAutoboxedOverloading.java --- /* * fb-contrib - Auxilliary detectors for Java programs * Copyright (C) 2005 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.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.ClassAnnotation; import edu.umd.cs.findbugs.Detector; import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.PreorderVisitor; public class ConfusingAutoboxedOverloading extends PreorderVisitor implements Detector, StatelessDetector { private static final int JDK15_MAJOR = 49; private static final int JDK15_MINOR = 0; private static final Set<String> primitiveSigs = new HashSet<String>(); static { primitiveSigs.add("I"); primitiveSigs.add("J"); primitiveSigs.add("D"); primitiveSigs.add("F"); } private BugReporter bugReporter; public ConfusingAutoboxedOverloading(BugReporter bugReporter) { this.bugReporter = bugReporter; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public void visitClassContext(ClassContext classContext) { JavaClass cls = classContext.getJavaClass(); if (cls.isClass() && (cls.getMajor() >= JDK15_MAJOR)) { Map<String, Set<String>> methodInfo = new HashMap<String, Set<String>>(); populateMethodInfo(cls, methodInfo); Method[] methods = cls.getMethods(); for (Method m : methods) { String name = m.getName(); String signature = m.getSignature(); Set<String> sigs = methodInfo.get(name); if (sigs != null) { for (String sig : sigs) { if (confusingSignatures(sig, signature)) { bugReporter.reportBug(new BugInstance(this, "CAO_CONFUSING_AUTOBOXED_OVERLOADING", NORMAL_PRIORITY) .addClass(cls.getClassName()) .addString(name + signature) .addString(name + sig)); } } } } } } private boolean confusingSignatures(String sig1, String sig2) { if (sig1.equals(sig2)) return false; Type[] type1 = Type.getArgumentTypes(sig1); Type[] type2 = Type.getArgumentTypes(sig2); if (type1.length != type2.length) return false; for (int i = 0; i < type1.length; i++) { Type t1 = type1[i]; Type t2 = type2[i]; if (!t1.getSignature().equals(t2.getSignature())) { if ("Ljava/lang/Character;".equals(t1.getSignature())) { if (!primitiveSigs.contains(t2.getSignature())) return false; } else if ("Ljava/lang/Character;".equals(t2.getSignature())) { if (!primitiveSigs.contains(t1.getSignature())) return false; } else return false; } } return true; } private void populateMethodInfo(JavaClass cls, Map<String, Set<String>> methodInfo) { try { if ("java.lang.Object".equals(cls.getClassName())) return; Method[] methods = cls.getMethods(); for (Method m : methods) { String sig = m.getSignature(); if (!isPossiblyConfusingSignature(sig)) continue; String name = m.getName(); Set<String> sigs = methodInfo.get(name); if (sigs == null) { sigs = new HashSet<String>(); methodInfo.put(name, sigs); } sigs.add(m.getSignature()); } populateMethodInfo(cls.getSuperClass(), methodInfo); } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); } } private boolean isPossiblyConfusingSignature(String sig) { Type[] types = Type.getArgumentTypes(sig); for (Type t : types) { sig = t.getSignature(); if (primitiveSigs.contains(sig)) return true; if ("Ljava/lang/Character;".equals(sig)) return true; } return false; } public void report() { } } |
|
From: Dave B. <dbr...@us...> - 2005-11-02 06:07:13
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4578/etc Modified Files: findbugs.xml messages.xml Log Message: new detector CAO - intial checkin Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- messages.xml 2 Nov 2005 04:57:26 -0000 1.29 +++ messages.xml 2 Nov 2005 06:07:00 -0000 1.30 @@ -225,7 +225,7 @@ </Details> </Detector> - <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverriding"> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading"> <Details> <![CDATA[ <p> Looks for methods that have the same signature, except where one uses a @@ -456,7 +456,7 @@ </Details> </BugPattern> - <BugPattern type="CAO_CONFUSING_AUTOBOXED_OVERRIDING"> + <BugPattern type="CAO_CONFUSING_AUTOBOXED_OVERLOADING"> <ShortDescription>class defines methods which confuse Character with int parameters</ShortDescription> <LongDescription>class {0} defines methods which confuse Character with int parameters</LongDescription> <Details> @@ -487,6 +487,6 @@ <BugCode abbrev="MAC">Manual Array Copy</BugCode> <BugCode abbrev="FPL">Floating Point Loops</BugCode> <BugCode abbrev="NCMU">Non Collection Method Use</BugCode> - <BugCode abbrev="CAO">Confusing Autoboxed Overriding</BugCode> + <BugCode abbrev="CAO">Confusing Autoboxed Overloading</BugCode> </MessageCollection> \ No newline at end of file Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- findbugs.xml 2 Nov 2005 04:57:26 -0000 1.30 +++ findbugs.xml 2 Nov 2005 06:07:00 -0000 1.31 @@ -78,9 +78,9 @@ speed="fast" reports="FPL_FLOATING_POINT_LOOPS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverriding" + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading" speed="fast" - reports="CAO_CONFUSING_AUTOBOXED_OVERRIDING" /> + reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" /> <!-- BugPattern --> @@ -101,6 +101,6 @@ <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" /> <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" /> <BugPattern abbrev="NCMU" type="NCMU_NON_COLLECTION_METHOD_USE" category="STYLE" experimental="true" /> - <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERRIDING" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERLOADING" category="CORRECTNESS" experimental="true" /> </FindbugsPlugin> \ No newline at end of file |
|
From: Dave B. <dbr...@us...> - 2005-11-02 05:29:09
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31981/src/com/mebigfatguy/fbcontrib/detect Modified Files: ConfusingAutoboxedOverriding.java Log Message: skip interfaces Index: ConfusingAutoboxedOverriding.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverriding.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ConfusingAutoboxedOverriding.java 2 Nov 2005 05:05:47 -0000 1.2 +++ ConfusingAutoboxedOverriding.java 2 Nov 2005 05:28:58 -0000 1.3 @@ -59,7 +59,8 @@ public void visitClassContext(ClassContext classContext) { JavaClass cls = classContext.getJavaClass(); - if (cls.getMajor() >= JDK15_MAJOR) { + + if (cls.isClass() && (cls.getMajor() >= JDK15_MAJOR)) { Map<String, Set<String>> methodInfo = new HashMap<String, Set<String>>(); populateMethodInfo(cls, methodInfo); |
|
From: Dave B. <dbr...@us...> - 2005-11-02 05:05:55
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29052/src/com/mebigfatguy/fbcontrib/detect Modified Files: ConfusingAutoboxedOverriding.java Log Message: fix the classname in the report Index: ConfusingAutoboxedOverriding.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverriding.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ConfusingAutoboxedOverriding.java 2 Nov 2005 04:57:26 -0000 1.1 +++ ConfusingAutoboxedOverriding.java 2 Nov 2005 05:05:47 -0000 1.2 @@ -23,13 +23,13 @@ import java.util.Map; import java.util.Set; -import org.apache.bcel.Constants; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.ClassAnnotation; import edu.umd.cs.findbugs.Detector; import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; @@ -74,7 +74,7 @@ for (String sig : sigs) { if (confusingSignatures(sig, signature)) { bugReporter.reportBug(new BugInstance(this, "CAO_CONFUSING_AUTOBOXED_OVERRIDING", NORMAL_PRIORITY) - .addClass(this) + .addClass(cls.getClassName()) .addString(name + signature) .addString(name + sig)); } |
|
From: Dave B. <dbr...@us...> - 2005-11-02 04:57:39
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27741/etc Modified Files: findbugs.xml messages.xml Log Message: new detector, CAO, initial check in Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- messages.xml 1 Nov 2005 05:41:14 -0000 1.28 +++ messages.xml 2 Nov 2005 04:57:26 -0000 1.29 @@ -225,6 +225,27 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverriding"> + <Details> + <![CDATA[ + <p> Looks for methods that have the same signature, except where one uses a + Character parameter, and the other uses an int, long, float, double parameter. + Since autoboxing is available in 1.5 one might assume that + <pre> + test('a') + </pre> + would map to + <pre> + public void test(Character c) + </pre> + but instead maps to one that takes an int long, float or double. + </p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + + <!-- BugPattern --> <BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING"> @@ -435,6 +456,18 @@ </Details> </BugPattern> + <BugPattern type="CAO_CONFUSING_AUTOBOXED_OVERRIDING"> + <ShortDescription>class defines methods which confuse Character with int parameters</ShortDescription> + <LongDescription>class {0} defines methods which confuse Character with int parameters</LongDescription> + <Details> + <![CDATA[ + <p>This class defines two methods that differ only by a parameter being defined + as Character vs. int, long, float or double. As autoboxing is present, it may be + assumed that a parameter of 'a' would map to the Character version, but does not.</p> + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -454,5 +487,6 @@ <BugCode abbrev="MAC">Manual Array Copy</BugCode> <BugCode abbrev="FPL">Floating Point Loops</BugCode> <BugCode abbrev="NCMU">Non Collection Method Use</BugCode> + <BugCode abbrev="CAO">Confusing Autoboxed Overriding</BugCode> </MessageCollection> \ No newline at end of file Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- findbugs.xml 1 Nov 2005 05:41:14 -0000 1.29 +++ findbugs.xml 2 Nov 2005 04:57:26 -0000 1.30 @@ -78,10 +78,9 @@ speed="fast" reports="FPL_FLOATING_POINT_LOOPS" /> - - <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverriding" speed="fast" - reports="NCMU_NON_COLLECTION_METHOD_USE" /> + reports="CAO_CONFUSING_AUTOBOXED_OVERRIDING" /> <!-- BugPattern --> @@ -102,5 +101,6 @@ <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" /> <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" /> <BugPattern abbrev="NCMU" type="NCMU_NON_COLLECTION_METHOD_USE" category="STYLE" experimental="true" /> + <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERRIDING" category="CORRECTNESS" experimental="true" /> </FindbugsPlugin> \ No newline at end of file |
|
From: Dave B. <dbr...@us...> - 2005-11-02 04:57:39
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27741/src/com/mebigfatguy/fbcontrib/detect Added Files: ConfusingAutoboxedOverriding.java Log Message: new detector, CAO, initial check in --- NEW FILE: ConfusingAutoboxedOverriding.java --- /* * fb-contrib - Auxilliary detectors for Java programs * Copyright (C) 2005 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.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.bcel.Constants; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.PreorderVisitor; public class ConfusingAutoboxedOverriding extends PreorderVisitor implements Detector, StatelessDetector { private static final int JDK15_MAJOR = 49; private static final int JDK15_MINOR = 0; private static final Set<String> primitiveSigs = new HashSet<String>(); static { primitiveSigs.add("I"); primitiveSigs.add("J"); primitiveSigs.add("D"); primitiveSigs.add("F"); } private BugReporter bugReporter; public ConfusingAutoboxedOverriding(BugReporter bugReporter) { this.bugReporter = bugReporter; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public void visitClassContext(ClassContext classContext) { JavaClass cls = classContext.getJavaClass(); if (cls.getMajor() >= JDK15_MAJOR) { Map<String, Set<String>> methodInfo = new HashMap<String, Set<String>>(); populateMethodInfo(cls, methodInfo); Method[] methods = cls.getMethods(); for (Method m : methods) { String name = m.getName(); String signature = m.getSignature(); Set<String> sigs = methodInfo.get(name); if (sigs != null) { for (String sig : sigs) { if (confusingSignatures(sig, signature)) { bugReporter.reportBug(new BugInstance(this, "CAO_CONFUSING_AUTOBOXED_OVERRIDING", NORMAL_PRIORITY) .addClass(this) .addString(name + signature) .addString(name + sig)); } } } } } } private boolean confusingSignatures(String sig1, String sig2) { if (sig1.equals(sig2)) return false; Type[] type1 = Type.getArgumentTypes(sig1); Type[] type2 = Type.getArgumentTypes(sig2); if (type1.length != type2.length) return false; for (int i = 0; i < type1.length; i++) { Type t1 = type1[i]; Type t2 = type2[i]; if (!t1.getSignature().equals(t2.getSignature())) { if ("Ljava/lang/Character;".equals(t1.getSignature())) { if (!primitiveSigs.contains(t2.getSignature())) return false; } else if ("Ljava/lang/Character;".equals(t2.getSignature())) { if (!primitiveSigs.contains(t1.getSignature())) return false; } else return false; } } return true; } private void populateMethodInfo(JavaClass cls, Map<String, Set<String>> methodInfo) { try { if ("java.lang.Object".equals(cls.getClassName())) return; Method[] methods = cls.getMethods(); for (Method m : methods) { String sig = m.getSignature(); if (!isPossiblyConfusingSignature(sig)) continue; String name = m.getName(); Set<String> sigs = methodInfo.get(name); if (sigs == null) { sigs = new HashSet<String>(); methodInfo.put(name, sigs); } sigs.add(m.getSignature()); } populateMethodInfo(cls.getSuperClass(), methodInfo); } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); } } private boolean isPossiblyConfusingSignature(String sig) { Type[] types = Type.getArgumentTypes(sig); for (Type t : types) { sig = t.getSignature(); if (primitiveSigs.contains(sig)) return true; if ("Ljava/lang/Character;".equals(sig)) return true; } return false; } public void report() { } } |
|
From: Dave B. <dbr...@us...> - 2005-11-02 04:57:39
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27741/samples Added Files: CAO_Sample.java Log Message: new detector, CAO, initial check in --- NEW FILE: CAO_Sample.java --- public class CAO_Sample { public void testci(Character c) { System.out.println("Character"); } public void testci(int i) { System.out.println("int"); } public void testcj(Character c) { System.out.println("Character"); } public void testcj(long l) { System.out.println("long"); } public void testcd(Character c) { System.out.println("Character"); } public void testcd(double d) { System.out.println("double"); } public void testcf(Character c) { System.out.println("Character"); } public void testcf(float f) { System.out.println("float"); } public static void main(String[] args) { CAO_Sample s = new CAO_Sample(); s.testci('a'); s.testcj('a'); s.testcd('a'); s.testcf('a'); } } |
|
From: Dave B. <dbr...@us...> - 2005-11-01 06:00:52
|
Update of /cvsroot/fb-contrib/fb-contrib/htdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5815/htdocs Modified Files: index.html Log Message: document NCMU Index: index.html =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/htdocs/index.html,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- index.html 30 Oct 2005 00:11:27 -0000 1.20 +++ index.html 1 Nov 2005 06:00:44 -0000 1.21 @@ -15,6 +15,15 @@ <a href="http://www.sourceforge.net/projects/fb-contrib">Project Page</a> <hr/> + Detectors added in CVS<br/> + Note: these detectors are still in testing + <ul> + <li><b>Non Collections Method Use</b><br/> + Finds calls to collections objects using methods that are not defined in the Collections interfaces, + but that have equivalent methods defined in such. By using the new methods, it allows for the + replacement of concrete classes with interfaces, and simplifies changing collection types if desired.</li> + </ul> + <hr/> Detectors added in v1.4.0<br/> <ul> <li><b>Final Parameters</b><br/> |
|
From: Dave B. <dbr...@us...> - 2005-11-01 05:41:22
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3408/src/com/mebigfatguy/fbcontrib/detect Added Files: NonCollectionMethodUse.java Log Message: new NCMU detector - intial checkin --- NEW FILE: NonCollectionMethodUse.java --- /* * fb-contrib - Auxilliary detectors for Java programs * Copyright (C) 2005 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.HashSet; import java.util.Set; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.StatelessDetector; public class NonCollectionMethodUse extends BytecodeScanningDetector implements StatelessDetector { private static Set<String> oldMethods = new HashSet<String>(); static { oldMethods.add("java/util/Hashtable.contains(java/lang/Object)Z"); oldMethods.add("java/util/Hashtable.elements()Ljava/util/Enumeration;"); oldMethods.add("java/util/Hashtable.keys()Ljava/util/Enumeration;"); oldMethods.add("java/util/Vector.addElement(Ljava/lang/Object;)V"); oldMethods.add("java/util/Vector.elementAt(I)Ljava/lang/Object;"); oldMethods.add("java/util/Vector.insertElementAt(Ljava/lang/Object;I)V"); oldMethods.add("java/util/Vector.removeAllElements()V"); oldMethods.add("java/util/Vector.removeElement(Ljava/lang/Object;)Z"); oldMethods.add("java/util/Vector.removeElementAt(I)V"); oldMethods.add("java/util/Vector.setElementAt(Ljava/lang/Object;I)V"); } private BugReporter bugReporter; public NonCollectionMethodUse(BugReporter bugReporter) { this.bugReporter = bugReporter; } public Object clone() throws CloneNotSupportedException { return super.clone(); } public void sawOpcode(int seen) { if (seen == INVOKEVIRTUAL) { String className = getClassConstantOperand(); String methodName = getNameConstantOperand(); String methodSig = getSigConstantOperand(); String methodInfo = className + "." + methodName + methodSig; if (oldMethods.contains(methodInfo)) { bugReporter.reportBug(new BugInstance(this, "NCMU_NON_COLLECTION_METHOD_USE", NORMAL_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this)); } } } } |
|
From: Dave B. <dbr...@us...> - 2005-11-01 05:41:21
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3408/etc Modified Files: findbugs.xml messages.xml Log Message: new NCMU detector - intial checkin Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- messages.xml 29 Oct 2005 19:39:14 -0000 1.27 +++ messages.xml 1 Nov 2005 05:41:14 -0000 1.28 @@ -201,6 +201,30 @@ </Details> </Detector> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse"> + <Details> + <![CDATA[ + <p> Looks for method calls to collection classes where the method is not defined by the Collections + interface, and an equivalent method exists in the interface. Examples include:<br> + <table border="1"> + <tr><th>Old Method</th><th>New Method</th></tr> + <tr><td>Hashtable.contains</td><td>Map.containsValue</td></tr> + <tr><td>Hashtable.elements</td><td>Map.elements</td></tr> + <tr><td>Hashtable.keys</td><td>Map.keySet</td></tr> + <tr><td>Vector.addElement</td><td>List.add</td></tr> + <tr><td>Vector.elementAt</td><td>List.get</td></tr> + <tr><td>Vector.insertElementAt</td><td>List.add</td></tr> + <tr><td>Vector.removeAllElements</td><td>List.clear</td></tr> + <tr><td>Vector.removeElement</td><td>List.remove</td></tr> + <tr><td>Vector.removeElementAt</td><td>List.remove</td></tr> + <tr><td>Vector.setElementAt</td><td>List.set</td></tr> + </table> + </p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> + <!-- BugPattern --> <BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING"> @@ -399,6 +423,18 @@ </Details> </BugPattern> + <BugPattern type="NCMU_NON_COLLECTION_METHOD_USE"> + <ShortDescription>method uses old non collections interface methods</ShortDescription> + <LongDescription>method {1} uses old non collections interface methods</LongDescription> + <Details> + <![CDATA[ + <p>This method makes calls to collection classes where the method is not defined by the Collections + interface, and an equivalent method exists in the interface. By using the new methods, + you can define this object by the Collections interface and allow better decoupling.</p> + ]]> + </Details> + </BugPattern> + <!-- BugCode --> <BugCode abbrev="ISB">Inefficient String Buffering</BugCode> @@ -417,5 +453,6 @@ <BugCode abbrev="ACEM">Abstract Class Empty Methods</BugCode> <BugCode abbrev="MAC">Manual Array Copy</BugCode> <BugCode abbrev="FPL">Floating Point Loops</BugCode> + <BugCode abbrev="NCMU">Non Collection Method Use</BugCode> </MessageCollection> \ No newline at end of file Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- findbugs.xml 30 Oct 2005 00:11:27 -0000 1.28 +++ findbugs.xml 1 Nov 2005 05:41:14 -0000 1.29 @@ -79,6 +79,10 @@ reports="FPL_FLOATING_POINT_LOOPS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" + speed="fast" + reports="NCMU_NON_COLLECTION_METHOD_USE" /> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -97,5 +101,6 @@ <BugPattern abbrev="ACEM" type="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" category="STYLE" /> <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" /> <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" /> + <BugPattern abbrev="NCMU" type="NCMU_NON_COLLECTION_METHOD_USE" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file |
|
From: Dave B. <dbr...@us...> - 2005-11-01 05:41:21
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3408/samples Added Files: NCMU_Sample.java Log Message: new NCMU detector - intial checkin --- NEW FILE: NCMU_Sample.java --- import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; public class NCMU_Sample { public void test(Vector v, Hashtable ht) { if (ht.contains("test")) { Enumeration e = ht.elements(); if (e.equals(ht.keys())) return; } v.addElement("test"); String s = (String)v.elementAt(0); v.insertElementAt("test", 0); v.removeAllElements(); v.removeElement("test"); v.removeElementAt(0); v.setElementAt("test", 0); } } |
|
From: Dave B. <dbr...@us...> - 2005-11-01 04:29:58
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25859/src/com/mebigfatguy/fbcontrib/detect Modified Files: OverlyConcreteParameter.java Log Message: Fix OCP Bug if a value is directly loaded or saved to a field in a parameter, then don't report it. Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- OverlyConcreteParameter.java 19 Oct 2005 04:08:48 -0000 1.21 +++ OverlyConcreteParameter.java 1 Nov 2005 04:29:49 -0000 1.22 @@ -123,7 +123,7 @@ parameterDefiners.clear(); } } - } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)) || (seen == PUTFIELD) || (seen == PUTSTATIC)) { + } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)) || (seen == PUTFIELD) || (seen == GETFIELD) || (seen == PUTSTATIC) || (seen == GETSTATIC)) { //Don't check parameters that are aliased if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); @@ -136,6 +136,21 @@ } else { parameterDefiners.clear(); } + + if ((seen == GETFIELD) || (seen == PUTFIELD)) { + if (stack.getStackDepth() > 1) { + OpcodeStack.Item itm = stack.getStackItem(1); + int reg = itm.getRegisterNumber(); + int parm = reg; + if (!methodIsStatic) + parm--; + if ((parm >= 0) && (parm < parmCount)) + parameterDefiners.remove(reg); + } else { + parameterDefiners.clear(); + } + } + } else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { int reg; if (seen == ALOAD) @@ -231,14 +246,6 @@ definers.put(ci, methodInfos); } } -/* It seems problematic to suggest using a super class so comment this out for now - for (JavaClass ci : cls.getSuperClasses()) { - List<String> methodInfos = getPublicMethodInfos(ci); - if (methodInfos.size() > 0) { - definers.put(ci, methodInfos); - } - } -*/ return definers; } |
|
From: Dave B. <dbr...@us...> - 2005-11-01 04:29:58
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25859/samples Modified Files: OCP_Sample.java Log Message: Fix OCP Bug if a value is directly loaded or saved to a field in a parameter, then don't report it. Index: OCP_Sample.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/samples/OCP_Sample.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OCP_Sample.java 11 Sep 2005 05:34:13 -0000 1.2 +++ OCP_Sample.java 1 Nov 2005 04:29:49 -0000 1.3 @@ -1,3 +1,4 @@ +import java.awt.Point; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -39,4 +40,25 @@ xr.setContentHandler( dh ); xr.parse(new InputSource( new FileInputStream(f))); } + + public void falsePositive(B b) + { + b.test(); + b.x = 4; + } + + public static interface A + { + public void test(); + } + + public static class B implements A + { + public int x = 0; + + public void test() + { + + } + } } |
|
From: Dave B. <dbr...@us...> - 2005-10-30 00:26:27
|
Update of /cvsroot/fb-contrib/fb-contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29630 Modified Files: build.xml Log Message: bump the version to 1.5.0 for development Index: build.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/build.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- build.xml 30 Oct 2005 00:11:27 -0000 1.11 +++ build.xml 30 Oct 2005 00:26:09 -0000 1.12 @@ -17,7 +17,7 @@ <property name="javac.deprecation" value="on"/> <property name="javac.debug" value="on"/> - <property name="fb-contrib.version" value="1.4.0"/> + <property name="fb-contrib.version" value="1.5.0"/> <target name="clean" description="removes all generated collateral"> <delete dir="${classes.dir}"/> |
|
From: Dave B. <dbr...@us...> - 2005-10-30 00:11:38
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27578/etc Modified Files: findbugs.xml Log Message: get ready for 1.4.0 Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- findbugs.xml 29 Oct 2005 19:39:14 -0000 1.27 +++ findbugs.xml 30 Oct 2005 00:11:27 -0000 1.28 @@ -93,9 +93,9 @@ <BugPattern abbrev="PCOA" type="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" category="CORRECTNESS" /> <BugPattern abbrev="DLC" type="DLC_DUBIOUS_LIST_COLLECTION" category="PERFORMANCE" /> <BugPattern abbrev="PL" type="PL_PARALLEL_LISTS" category="STYLE" /> - <BugPattern abbrev="FP" type="FP_FINAL_PARAMETERS" category="STYLE" experimental="true" /> - <BugPattern abbrev="ACEM" type="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" category="STYLE" experimental="true" /> - <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" experimental="true" /> - <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="FP" type="FP_FINAL_PARAMETERS" category="STYLE" /> + <BugPattern abbrev="ACEM" type="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" category="STYLE" /> + <BugPattern abbrev="MAC" type="MAC_MANUAL_ARRAY_COPY" category="PERFORMANCE" /> + <BugPattern abbrev="FPL" type="FPL_FLOATING_POINT_LOOPS" category="CORRECTNESS" /> </FindbugsPlugin> \ No newline at end of file |