[Fb-contrib-commit] fb-contrib/src/com/mebigfatguy/fbcontrib/detect AbnormalFinallyBlockReturn.java,
Brought to you by:
dbrosius
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19094/src/com/mebigfatguy/fbcontrib/detect Modified Files: AbnormalFinallyBlockReturn.java AbstractClassEmptyMethods.java ClassEnvy.java ConfusingAutoboxedOverloading.java CyclomaticComplexity.java DeclaredRuntimeException.java DubiousListCollection.java FinalParameters.java FloatingPointLoops.java InefficientStringBuffering.java ListIndexedIterating.java LiteralStringComparison.java ManualArrayCopy.java NeedlessAutoboxing.java NonCollectionMethodUse.java OverlyConcreteParameter.java ParallelLists.java PartiallyConstructedObjectAccess.java SpuriousThreadStates.java StaticMethodInstanceInvocation.java SyncCollectionIterators.java UnnecessaryStoreBeforeReturn.java UnrelatedCollectionContents.java Log Message: more javadoc Index: NonCollectionMethodUse.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- NonCollectionMethodUse.java 16 Nov 2005 07:08:59 -0000 1.2 +++ NonCollectionMethodUse.java 5 Dec 2005 05:21:15 -0000 1.3 @@ -43,10 +43,19 @@ } private BugReporter bugReporter; + /** + * constructs a NCMU detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public NonCollectionMethodUse(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: AbstractClassEmptyMethods.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AbstractClassEmptyMethods.java 16 Nov 2005 07:08:59 -0000 1.2 +++ AbstractClassEmptyMethods.java 5 Dec 2005 05:21:15 -0000 1.3 @@ -30,6 +30,10 @@ import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; +/** + * finds methods of abstract classes that do nothing, or just throw exceptions. Since this is an + * abstract class, it may be more correct to just leave the method abstract. + */ public class AbstractClassEmptyMethods extends BytecodeScanningDetector implements StatelessDetector { public static final int SEEN_NOTHING = 0; @@ -51,10 +55,19 @@ private String methodName; private int state; + /** + * constructs a ACEM detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public AbstractClassEmptyMethods(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: NeedlessAutoboxing.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- NeedlessAutoboxing.java 3 Dec 2005 03:36:19 -0000 1.2 +++ NeedlessAutoboxing.java 5 Dec 2005 05:21:15 -0000 1.3 @@ -49,10 +49,19 @@ private int state; private String boxClass; + /** + * constructs a NAB detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public NeedlessAutoboxing(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ public Object clone() throws CloneNotSupportedException { return super.clone(); } Index: ConfusingAutoboxedOverloading.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ConfusingAutoboxedOverloading.java 16 Nov 2005 07:08:59 -0000 1.3 +++ ConfusingAutoboxedOverloading.java 5 Dec 2005 05:21:15 -0000 1.4 @@ -47,10 +47,19 @@ } private BugReporter bugReporter; + /** + * constructs a CAO detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public ConfusingAutoboxedOverloading(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: ParallelLists.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ParallelLists.java 1 Oct 2005 07:38:02 -0000 1.6 +++ ParallelLists.java 5 Dec 2005 05:21:15 -0000 1.7 @@ -42,10 +42,19 @@ private Set<String> listFields = new HashSet<String>(); private Map<Integer, String> indexToFieldMap = new HashMap<Integer, String>(); + /** + * constructs a PL detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public ParallelLists(final BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: PartiallyConstructedObjectAccess.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PartiallyConstructedObjectAccess.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PartiallyConstructedObjectAccess.java 1 Oct 2005 07:38:02 -0000 1.3 +++ PartiallyConstructedObjectAccess.java 5 Dec 2005 05:21:15 -0000 1.4 @@ -36,11 +36,20 @@ private OpcodeStack stack; private boolean reportedCtor; + /** + * constructs a PCOA detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public PartiallyConstructedObjectAccess(final BugReporter bugReporter) { this.bugReporter = bugReporter; stack = new OpcodeStack(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: SpuriousThreadStates.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SpuriousThreadStates.java 5 Dec 2005 04:27:30 -0000 1.3 +++ SpuriousThreadStates.java 5 Dec 2005 05:21:15 -0000 1.4 @@ -32,10 +32,19 @@ private BugReporter bugReporter; private OpcodeStack stack = new OpcodeStack(); + /** + * constructs a STS detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public SpuriousThreadStates(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ public Object clone() throws CloneNotSupportedException { return super.clone(); } Index: DubiousListCollection.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- DubiousListCollection.java 5 Dec 2005 04:29:50 -0000 1.7 +++ DubiousListCollection.java 5 Dec 2005 05:21:15 -0000 1.8 @@ -62,6 +62,10 @@ private OpcodeStack stack = new OpcodeStack(); private Map<String, Integer> fieldsReported = new HashMap<String, Integer>(); + /** + * constructs a DLC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public DubiousListCollection(final BugReporter bugReporter) { this.bugReporter = bugReporter; } Index: AbnormalFinallyBlockReturn.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- AbnormalFinallyBlockReturn.java 5 Dec 2005 05:00:50 -0000 1.6 +++ AbnormalFinallyBlockReturn.java 5 Dec 2005 05:21:15 -0000 1.7 @@ -43,6 +43,7 @@ /** * constructs a AFBR detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports */ public AbnormalFinallyBlockReturn(final BugReporter bugReporter) { Index: FinalParameters.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- FinalParameters.java 29 Oct 2005 23:33:24 -0000 1.8 +++ FinalParameters.java 5 Dec 2005 05:21:15 -0000 1.9 @@ -56,10 +56,19 @@ private String[] sourceLines; + /** + * constructs a FP detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public FinalParameters(final BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: UnnecessaryStoreBeforeReturn.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- UnnecessaryStoreBeforeReturn.java 4 Dec 2005 06:41:24 -0000 1.4 +++ UnnecessaryStoreBeforeReturn.java 5 Dec 2005 05:21:15 -0000 1.5 @@ -61,19 +61,31 @@ private int storeReg; private int loadReg; + /** + * constructs a USBR detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public UnnecessaryStoreBeforeReturn(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ + @Override public Object clone() throws CloneNotSupportedException { return super.clone(); } + @Override public void visitMethod(Method obj) { state = SEEN_NOTHING; branchTargets.clear(); } + @Override public void sawOpcode(int seen) { switch (state) { case SEEN_NOTHING: Index: FloatingPointLoops.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- FloatingPointLoops.java 16 Nov 2005 07:08:59 -0000 1.6 +++ FloatingPointLoops.java 5 Dec 2005 05:21:15 -0000 1.7 @@ -40,10 +40,19 @@ BugReporter bugReporter; private Set<FloatForLoop> forLoops = new HashSet<FloatForLoop>(); + /** + * constructs a FPL detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public FloatingPointLoops(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ListIndexedIterating.java 5 Nov 2005 01:54:27 -0000 1.8 +++ ListIndexedIterating.java 5 Dec 2005 05:21:15 -0000 1.9 @@ -51,12 +51,21 @@ private int loopReg; private boolean sawListSize; + /** + * constructs a LII detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public ListIndexedIterating(final BugReporter bugReporter) { this.bugReporter = bugReporter; stack = new OpcodeStack(); possibleForLoops = new HashSet<ForLoop>(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: SyncCollectionIterators.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- SyncCollectionIterators.java 4 Dec 2005 03:47:36 -0000 1.8 +++ SyncCollectionIterators.java 5 Dec 2005 05:21:15 -0000 1.9 @@ -64,10 +64,19 @@ private OpcodeStack stack = new OpcodeStack(); private Object collectionInfo = null; + /** + * constructs a SCI detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public SyncCollectionIterators(final BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ClassEnvy.java 7 Nov 2005 02:50:11 -0000 1.15 +++ ClassEnvy.java 5 Dec 2005 05:21:15 -0000 1.16 @@ -61,6 +61,10 @@ private double envyPercent = 0.90; private int envyMin = 5; + /** + * constructs a CE detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public ClassEnvy(final BugReporter bugReporter) { this.bugReporter = bugReporter; stack = new OpcodeStack(); @@ -77,6 +81,11 @@ envyMin = min.intValue(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: LiteralStringComparison.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- LiteralStringComparison.java 1 Oct 2005 07:38:02 -0000 1.4 +++ LiteralStringComparison.java 5 Dec 2005 05:21:15 -0000 1.5 @@ -30,11 +30,20 @@ private BugReporter bugReporter; private OpcodeStack stack; + /** + * constructs a LSC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public LiteralStringComparison(final BugReporter bugReporter) { this.bugReporter = bugReporter; stack = new OpcodeStack(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- OverlyConcreteParameter.java 11 Nov 2005 02:51:11 -0000 1.24 +++ OverlyConcreteParameter.java 5 Dec 2005 05:21:15 -0000 1.25 @@ -54,6 +54,10 @@ private boolean methodImplementsInterface; private boolean methodIsStatic; + /** + * constructs a OCP detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public OverlyConcreteParameter(final BugReporter bugReporter) { this.bugReporter = bugReporter; try { @@ -64,6 +68,11 @@ } } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: DeclaredRuntimeException.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- DeclaredRuntimeException.java 5 Dec 2005 04:29:06 -0000 1.6 +++ DeclaredRuntimeException.java 5 Dec 2005 05:21:15 -0000 1.7 @@ -49,10 +49,19 @@ } } + /** + * constructs a DRE detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public DeclaredRuntimeException(final BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: UnrelatedCollectionContents.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- UnrelatedCollectionContents.java 3 Dec 2005 03:36:51 -0000 1.9 +++ UnrelatedCollectionContents.java 5 Dec 2005 05:21:15 -0000 1.10 @@ -57,11 +57,20 @@ private Map<String, Set<SourceLineAnnotation>>memberSourceLineAnnotations; private Map<Integer, Set<SourceLineAnnotation>>localSourceLineAnnotations; + /** + * constructs a UCC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public UnrelatedCollectionContents(final BugReporter bugReporter) { this.bugReporter = bugReporter; stack = new OpcodeStack(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: CyclomaticComplexity.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CyclomaticComplexity.java 10 Oct 2005 07:05:01 -0000 1.6 +++ CyclomaticComplexity.java 5 Dec 2005 05:21:15 -0000 1.7 @@ -43,6 +43,10 @@ private ClassContext classContext; private int reportLimit = 50; + /** + * constructs a CC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public CyclomaticComplexity(final BugReporter bugReporter) { this.bugReporter = bugReporter; Integer limit = Integer.getInteger(LIMIT_PROPERTY); @@ -50,6 +54,11 @@ reportLimit = limit.intValue(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: StaticMethodInstanceInvocation.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- StaticMethodInstanceInvocation.java 17 Nov 2005 05:23:15 -0000 1.3 +++ StaticMethodInstanceInvocation.java 5 Dec 2005 05:21:15 -0000 1.4 @@ -37,10 +37,19 @@ private OpcodeStack stack = new OpcodeStack(); private List<PopInfo> popStack = new ArrayList<PopInfo>(); + /** + * constructs a SMII detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public StaticMethodInstanceInvocation(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: ManualArrayCopy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ManualArrayCopy.java 16 Nov 2005 07:08:59 -0000 1.2 +++ ManualArrayCopy.java 5 Dec 2005 05:21:15 -0000 1.3 @@ -38,10 +38,19 @@ private int arrayIndexReg; private int loadInstruction; + /** + * constructs a MAC detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public ManualArrayCopy(BugReporter bugReporter) { this.bugReporter = bugReporter; } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); Index: InefficientStringBuffering.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- InefficientStringBuffering.java 18 Oct 2005 04:22:42 -0000 1.5 +++ InefficientStringBuffering.java 5 Dec 2005 05:21:15 -0000 1.6 @@ -32,11 +32,20 @@ private BugReporter bugReporter; private OpcodeStack opStack; + /** + * constructs a ISB detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ public InefficientStringBuffering(final BugReporter bugReporter) { this.bugReporter = bugReporter; opStack = new OpcodeStack(); } + /** + * clone this detector so that it can be a StatelessDetector + * + * @return a clone of this object + */ @Override public Object clone() throws CloneNotSupportedException { return super.clone(); |