fb-contrib-commit Mailing List for fb-contrib (Page 10)
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...> - 2010-09-19 03:37:37
|
Revision: 1615 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1615&view=rev Author: dbrosius Date: 2010-09-19 03:37:29 +0000 (Sun, 19 Sep 2010) Log Message: ----------- add SPP_EMPTY_CASING to SPP Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/samples/SPP_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-09-19 02:30:45 UTC (rev 1614) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-19 03:37:29 UTC (rev 1615) @@ -132,7 +132,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" /> <Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast" - reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TRINARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM" /> + reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TRINARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM,SPP_EMPTY_CASING" /> <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> @@ -310,6 +310,7 @@ <BugPattern abbrev="SPP" type="SPP_USELESS_CASING" category="PERFORMANCE" /> <BugPattern abbrev="SPP" type="SPP_SERIALVER_SHOULD_BE_PRIVATE" category="STYLE" /> <BugPattern abbrev="SPP" type="SPP_NON_ARRAY_PARM" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_EMPTY_CASING" category="STYLE" /> <BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" /> <BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR" category="STYLE" /> <BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-19 02:30:45 UTC (rev 1614) +++ trunk/fb-contrib/etc/messages.xml 2010-09-19 03:37:29 UTC (rev 1615) @@ -2402,6 +2402,17 @@ ]]> </Details> </BugPattern> + + <BugPattern type="SPP_EMPTY_CASING"> + <ShortDescription>Method passes an empty string to equalsIgnoreCase or compareToIgnoreCase</ShortDescription> + <LongDescription>Method {1} passes an empty string to equalsIgnoreCase or compareToIgnoreCase</LongDescription> + <Details> + <![CDATA[ + This method passes the empty string "" to equalsIgnoreCase or compareToIgnoreCase, as the empty string + is not case sensitive using equals is simpler. It would be even simpler to do a length() == 0 test. + ]]> + </Details> + </BugPattern> <BugPattern type="BAS_BLOATED_ASSIGNMENT_SCOPE"> <ShortDescription>Method assigns a variable in a larger scope then is needed</ShortDescription> Modified: trunk/fb-contrib/samples/SPP_Sample.java =================================================================== --- trunk/fb-contrib/samples/SPP_Sample.java 2010-09-19 02:30:45 UTC (rev 1614) +++ trunk/fb-contrib/samples/SPP_Sample.java 2010-09-19 03:37:29 UTC (rev 1615) @@ -278,11 +278,13 @@ public boolean testCasing(String a, String b) { - if (a.toUpperCase().equalsIgnoreCase(b)) - return true; + if (a.toUpperCase().equalsIgnoreCase(b)) { + return true; + } - if (a.toLowerCase().compareToIgnoreCase(b) == 0) - return true; + if (a.toLowerCase().compareToIgnoreCase(b) == 0) { + return true; + } return false; } @@ -314,4 +316,9 @@ Array.setInt(notAnArray, 0, 1); } + + public boolean testEmptyIgnoreCase(String s) + { + return (s.equalsIgnoreCase("")); + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2010-09-19 02:30:45 UTC (rev 1614) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2010-09-19 03:37:29 UTC (rev 1615) @@ -279,7 +279,7 @@ bug = false; } branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[3])); - if ((branchInsSet != null) && branchInsSet.size() > 1) + if ((branchInsSet != null) && (branchInsSet.size() > 1)) { bug = false; } @@ -473,6 +473,14 @@ .addMethod(this) .addSourceLine(this)); } + item = stack.getStackItem(0); + String parm = (String)item.getConstant(); + if ((parm != null) && (parm.length() == 0)) { + bugReporter.reportBug(new BugInstance(this, "SPP_EMPTY_CASING", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } } } } else if ("equals(Ljava/lang/Object;)Z".equals(methodName + getSigConstantOperand())) { @@ -633,7 +641,7 @@ } finally { stack.sawOpcode(this, seen); - if ((userValue != null) && stack.getStackDepth() > 0) { + if ((userValue != null) && (stack.getStackDepth() > 0)) { OpcodeStack.Item item = stack.getStackItem(0); item.setUserValue(userValue); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-19 02:30:51
|
Revision: 1614 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1614&view=rev Author: dbrosius Date: 2010-09-19 02:30:45 +0000 (Sun, 19 Sep 2010) Log Message: ----------- Redo SNG to look for if (a != null) a = somevalue; Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/htdocs/index.shtml trunk/fb-contrib/samples/SNG_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-17 04:51:05 UTC (rev 1613) +++ trunk/fb-contrib/etc/messages.xml 2010-09-19 02:30:45 UTC (rev 1614) @@ -1081,10 +1081,9 @@ <Details> <![CDATA[ <p>Looks for code that checks to see if a field or local variable is not null, - before entering a code block either an if, or while statement, and then doesn't - reference that field or local in the block of code that is guarded by the null - check. It is likely that null check is being done on the wrong variable, either - because of a copy/paste error, or a change in implementation.</p> + before entering a code block either an if, or while statement, and then reassigns that + field or local variable. It is likely that guard should have been to see if that + field or local variable is null, not, not null</p> <p>It is a fast detector</p> ]]> </Details> @@ -2953,26 +2952,25 @@ </BugPattern> <BugPattern type="SNG_SUSPICIOUS_NULL_FIELD_GUARD"> - <ShortDescription>Method tests a field for null as guard for code that doesn't use it</ShortDescription> - <LongDescription>Method {1} tests a field for null as guard for code that doesn't use it</LongDescription> + <ShortDescription>Method tests a field for not null as guard and reassigns it</ShortDescription> + <LongDescription>Method {1} tests a field for not null as guard and reassigns it</LongDescription> <Details> <![CDATA[ <p>This method tests a field to make sure it's not null before executing a conditional block of - code. However, it does not appear that this block of code relies on the field in question, so the - choice of null guard seems dubious. It is possible that the code block calls a method that requires - this field not to be null, but that would seem like an odd construct.</p> + code. However in the conditional block is reassigns the field. It is likely that the guard + should have been a check to see if the field is null, not that the field was not null.</p> ]]> </Details> </BugPattern> <BugPattern type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD"> - <ShortDescription>Method tests a local variable for null as guard for code that doesn't use it</ShortDescription> - <LongDescription>Method {1} tests a local variable for null as guard for code that doesn't use it</LongDescription> + <ShortDescription>Method tests a local variable for not null as guard and reassigns it</ShortDescription> + <LongDescription>Method {1} tests a local variable for not null as guard and reassigns it</LongDescription> <Details> <![CDATA[ <p>This method tests a local variable to make sure it's not null before executing a conditional block of - code. However, this block of does not access the local variable in question, so the - choice of null guard seems wrong. Perhaps this is a copy/paste mistake.</p> + code. However in the conditional block is reassigns the local variable. It is likely that the guard + should have been a check to see if the local variable is null, not that the local variable was not null.</p> ]]> </Details> </BugPattern> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-09-17 04:51:05 UTC (rev 1613) +++ trunk/fb-contrib/htdocs/index.shtml 2010-09-19 02:30:45 UTC (rev 1614) @@ -82,12 +82,10 @@ must be restricted to covariant or invariant usage. <span style="color: #0000FF;">--contributed by Bhaskar Maddala - THANKS!</span></li> <li><b>[SNG] Suspicious Null Guard</b><br/> - Looks for code that checks to see if a field or local variable is not null, - before entering a code block (either an if, or while statement) and then doesn't - reference that field or local in the block of code that is guarded by the null - check. Instead it references another object of the same type. It is likely that null - check is being done on the wrong variable, either because of a copy/paste error, - or a change in implementation.</li> + Looks for code that checks to see if a field or local variable is not null + before entering a code block either an if, or while statement, and reassigns + that field or variable. It seems that perhaps the guard should check if the field + or variable is null.</li> <li><b>[PUS] Possible Unsuspected Serialization</b><br/> Looks for serialization of non-static inner classes. As this serializes the enclosing class, it may unintentionally bring in more to the serialization Modified: trunk/fb-contrib/samples/SNG_Sample.java =================================================================== --- trunk/fb-contrib/samples/SNG_Sample.java 2010-09-17 04:51:05 UTC (rev 1613) +++ trunk/fb-contrib/samples/SNG_Sample.java 2010-09-19 02:30:45 UTC (rev 1614) @@ -7,104 +7,33 @@ private Object f1 = null; private final Object f2 = null; private final File file = null; - private byte[] buffer = null; + private final byte[] buffer = null; - public String badSNGFields() + public void badSNGFields() { if (f1 != null) { - return f2.toString(); + f1 = "Foo"; } - - return null; } - public String badSNGLocals(Object l1, Object l2) + public void badSNGLocals(Object l1, Object l2) { if (l1 != null) { - return l2.toString(); - } - - return null; + l1 = l2; + } } - public boolean fpReturn(Object o) - { - return o != null; - } - - public boolean fpAssign(Object o) - { - boolean b = o != null; - return b; - } - - public boolean fpField() - { - if (f1 != null) - { - return true; + public void fpNGFieldSetToNull() { + if (f1 != null) { + f1 = null; } - - return false; } - public void fpAssert() - { - assert (f1 != null) && f1.equals(f2); - } - - public Object fpSetNull(Object o) { - if (o != null) - { - o = null; + public void fpNGLocalSetToNull(String s1) { + if (s1 != null) { + s1 = null; } - - return o; } - - public void fpSetMemberNull() - { - if (f1 != null) - { - f1 = null; - } - } - - public void fpDual(Object o1, Object o2) - { - if ((o1 == null) || (o2 == null)) - { - throw new IllegalArgumentException("o1/o2 can not be null"); - } - } - - public void discard() - { - if (file != null) - { - file.delete(); - } - else if (buffer != null) - { - buffer = EMPTY_BYTE_ARRAY; - } - } - - public void fpCompound() - { - if ((file == null) || (buffer[0] == 0)) - { - f1 = f2; - } - } - - public void fpDup() - { - if ((f1 == null) || file.isDirectory()) - { - f1 = file.getPath(); - } - } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-09-17 04:51:05 UTC (rev 1613) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-09-19 02:30:45 UTC (rev 1614) @@ -19,12 +19,9 @@ package com.mebigfatguy.fbcontrib.detect; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import org.apache.bcel.classfile.Code; -import org.apache.bcel.classfile.LocalVariable; -import org.apache.bcel.classfile.LocalVariableTable; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; @@ -37,16 +34,14 @@ /** * looks for code that checks to see if a field or local variable is not null, - * before entering a code block either an if, or while statement, and then doesn't - * reference that field or local in the block of code that is guarded by the null - * check. It is likely that null check is being done on the wrong variable, either - * because of a copy/paste error, or a change in implementation. + * before entering a code block either an if, or while statement, and reassigns + * that field or variable. It seems that perhaps the guard should check if the field + * or variable is null. */ public class SuspiciousNullGuard extends BytecodeScanningDetector { private final BugReporter bugReporter; private OpcodeStack stack; - private LocalVariableTable lvt; private Map<Integer, NullGuard> nullGuards; /** @@ -80,14 +75,9 @@ */ @Override public void visitCode(Code obj) { - try { - stack.resetForMethodEntry(this); - lvt = getMethod().getLocalVariableTable(); - nullGuards.clear(); - super.visitCode(obj); - } finally { - lvt = null; - } + stack.resetForMethodEntry(this); + nullGuards.clear(); + super.visitCode(obj); } /** @@ -99,14 +89,7 @@ public void sawOpcode(int seen) { try { Integer pc = Integer.valueOf(getPC()); - NullGuard guard = nullGuards.remove(pc); - if ((guard != null) && guard.sawSignatureOfGuard()) { - boolean localBug = guard.getRegister() >= 0; - bugReporter.reportBug(new BugInstance(this, localBug ? "SNG_SUSPICIOUS_NULL_LOCAL_GUARD" : "SNG_SUSPICIOUS_NULL_FIELD_GUARD", localBug ? NORMAL_PRIORITY : LOW_PRIORITY) - .addClass(this) - .addMethod(this) - .addSourceLine(this, guard.getLocation())); - } + nullGuards.remove(pc); switch (seen) { case IFNULL: { @@ -125,140 +108,93 @@ } } break; - - case IFEQ: - case IFNE: - case IFLE: - case IFGE: - case IFGT: - case IFLT: - case IF_ICMPEQ: - case IF_ICMPNE: - case IF_ICMPGT: - case IF_ICMPLE: - case IF_ACMPEQ: - case IF_ACMPNE: { - int target = getBranchTarget(); - removeGuardsBeforePC(target); - } - break; - - - case ALOAD: - case ALOAD_0: - case ALOAD_1: - case ALOAD_2: - case ALOAD_3: { - if (lvt != null) { - LocalVariable lv = lvt.getLocalVariable(RegisterUtils.getALoadReg(this, seen), getNextPC()); - if (lv != null) { - markNullGuards(lv.getSignature()); - } - } - } - break; case ASTORE: case ASTORE_0: case ASTORE_1: case ASTORE_2: case ASTORE_3: { - removeGuardForRegister(RegisterUtils.getAStoreReg(this, seen)); + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + if (!item.isNull()) { + NullGuard guard = findNullGuardWithRegister(RegisterUtils.getAStoreReg(this, seen)); + if (guard != null) { + bugReporter.reportBug(new BugInstance(this, "SNG_SUSPICIOUS_NULL_LOCAL_GUARD", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + nullGuards.remove(guard); + } + } + } } break; - case GETFIELD: { - markNullGuards(getSigConstantOperand()); - } - break; - case PUTFIELD: { - removeGuardForField(getXField()); - } - break; - - case INVOKEVIRTUAL: - case INVOKEINTERFACE: { - if (nullGuards.size() > 0) { - String clsName = getClassConstantOperand(); - String methodName = getNameConstantOperand(); - if ("java/io/PrintStream".equals(clsName) && methodName.startsWith("print")) { - nullGuards.clear(); + if (stack.getStackDepth() > 1) { + OpcodeStack.Item item = stack.getStackItem(0); + if (!item.isNull()) { + XField xf = getXFieldOperand(); + if (xf != null) { + NullGuard guard = findNullGuardWithField(xf); + if (guard != null) { + bugReporter.reportBug(new BugInstance(this, "SNG_SUSPICIOUS_NULL_FIELD_GUARD", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + nullGuards.remove(guard); + } + } } } } break; - + + case IFEQ: + case IFNE: + case IFLT: + case IFGE: + case IFGT: + case IFLE: + case IF_ICMPEQ: + case IF_ICMPNE: + case IF_ICMPLT: + case IF_ICMPGE: + case IF_ICMPGT: + case IF_ICMPLE: + case IF_ACMPEQ: + case IF_ACMPNE: + case GOTO: + case GOTO_W: case IFNONNULL: - case ATHROW: { - nullGuards.clear(); - } + nullGuards.clear(); break; - - case GOTO: { - if (stack.getStackDepth() > 0) { - nullGuards.clear(); - } - } - break; } } finally { stack.sawOpcode(this, seen); - if (stack.getStackDepth() > 0) { - OpcodeStack.Item item = stack.getStackItem(0); - int reg = item.getRegisterNumber(); - if (reg >= 0) { - removeGuardForRegister(reg); - } else { - XField field = item.getXField(); - if (field != null) { - removeGuardForField(field); - } - } - } } } - private void markNullGuards(String signature) { - for (NullGuard ng : nullGuards.values()) { - if (ng.getSignature().equals(signature)) { - ng.markSignatureOfGuard(); + private NullGuard findNullGuardWithRegister(int reg) { + for (NullGuard guard : nullGuards.values()) { + if (guard.getRegister() == reg) { + return guard; } } + + return null; } - private void removeGuardForRegister(int reg) { - Iterator<NullGuard> it = nullGuards.values().iterator(); - while (it.hasNext()) { - NullGuard guard = it.next(); - if (reg == guard.getRegister()) { - it.remove(); + private NullGuard findNullGuardWithField(XField field) { + for (NullGuard guard : nullGuards.values()) { + if (field.equals(guard.getField())) { + return guard; } } + + return null; } - private void removeGuardForField(XField field) { - Iterator<NullGuard> it = nullGuards.values().iterator(); - while (it.hasNext()) { - NullGuard guard = it.next(); - if (field != null) { - if (field.equals(guard.getField())) { - it.remove(); - } - } - } - } - - private void removeGuardsBeforePC(int pc) { - Iterator<Integer> it = nullGuards.keySet().iterator(); - while (it.hasNext()) { - Integer nullGuardPC = it.next(); - if (pc > nullGuardPC) { - it.remove(); - } - } - } - static class NullGuard { int register; XField field; @@ -296,13 +232,5 @@ public String getSignature() { return signature; } - - public void markSignatureOfGuard() { - sawSignature = true; - } - - public boolean sawSignatureOfGuard() { - return sawSignature; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-17 04:51:13
|
Revision: 1613 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1613&view=rev Author: dbrosius Date: 2010-09-17 04:51:05 +0000 (Fri, 17 Sep 2010) Log Message: ----------- List.set isn't an iterator concurrent failfast operation Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2010-09-13 05:15:21 UTC (rev 1612) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2010-09-17 04:51:05 UTC (rev 1613) @@ -87,8 +87,6 @@ modifyingMethods.put("remove(I)Ljava/lang/Object;", Integer.valueOf(1)); modifyingMethods.put("removeAll(Ljava/util/Collection;)Z", Integer.valueOf(1)); modifyingMethods.put("retainAll(Ljava/util/Collection;)Z", Integer.valueOf(1)); - modifyingMethods.put("set(ILjava/lang/Object;)Ljava/lang/Object;", Integer.valueOf(2)); - } private BugReporter bugReporter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-13 05:15:28
|
Revision: 1612 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1612&view=rev Author: dbrosius Date: 2010-09-13 05:15:21 +0000 (Mon, 13 Sep 2010) Log Message: ----------- attempt to reduce FP on SNG by removing compound conditionals Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/samples/SNG_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-09-13 02:00:34 UTC (rev 1611) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-13 05:15:21 UTC (rev 1612) @@ -195,7 +195,9 @@ <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> --> <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> - <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" />--> + + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> Modified: trunk/fb-contrib/samples/SNG_Sample.java =================================================================== --- trunk/fb-contrib/samples/SNG_Sample.java 2010-09-13 02:00:34 UTC (rev 1611) +++ trunk/fb-contrib/samples/SNG_Sample.java 2010-09-13 05:15:21 UTC (rev 1612) @@ -99,4 +99,12 @@ f1 = f2; } } + + public void fpDup() + { + if ((f1 == null) || file.isDirectory()) + { + f1 = file.getPath(); + } + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-09-13 02:00:34 UTC (rev 1611) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousNullGuard.java 2010-09-13 05:15:21 UTC (rev 1612) @@ -44,7 +44,7 @@ */ public class SuspiciousNullGuard extends BytecodeScanningDetector { - private BugReporter bugReporter; + private final BugReporter bugReporter; private OpcodeStack stack; private LocalVariableTable lvt; private Map<Integer, NullGuard> nullGuards; @@ -126,6 +126,24 @@ } break; + case IFEQ: + case IFNE: + case IFLE: + case IFGE: + case IFGT: + case IFLT: + case IF_ICMPEQ: + case IF_ICMPNE: + case IF_ICMPGT: + case IF_ICMPLE: + case IF_ACMPEQ: + case IF_ACMPNE: { + int target = getBranchTarget(); + removeGuardsBeforePC(target); + } + break; + + case ALOAD: case ALOAD_0: case ALOAD_1: @@ -193,8 +211,9 @@ removeGuardForRegister(reg); } else { XField field = item.getXField(); - if (field != null) + if (field != null) { removeGuardForField(field); + } } } } @@ -230,6 +249,16 @@ } } + private void removeGuardsBeforePC(int pc) { + Iterator<Integer> it = nullGuards.keySet().iterator(); + while (it.hasNext()) { + Integer nullGuardPC = it.next(); + if (pc > nullGuardPC) { + it.remove(); + } + } + } + static class NullGuard { int register; XField field; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-13 02:00:42
|
Revision: 1611 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1611&view=rev Author: dbrosius Date: 2010-09-13 02:00:34 +0000 (Mon, 13 Sep 2010) Log Message: ----------- Uppercase first letter of <ShortDescription> or <LongDescription> Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-11 15:41:55 UTC (rev 1610) +++ trunk/fb-contrib/etc/messages.xml 2010-09-13 02:00:34 UTC (rev 1611) @@ -1196,8 +1196,8 @@ <!-- BugPattern --> <BugPattern type="ISB_INEFFICIENT_STRING_BUFFERING"> - <ShortDescription>method passes simple concatenating string in StringBuffer or StringBuilder append</ShortDescription> - <LongDescription>method {1} passes simple concatenating string in StringBuffer or StringBuilder append</LongDescription> + <ShortDescription>Method passes simple concatenating string in StringBuffer or StringBuilder append</ShortDescription> + <LongDescription>Method {1} passes simple concatenating string in StringBuffer or StringBuilder append</LongDescription> <Details> <![CDATA[ <p> This method uses StringBuffer or StringBuilder append to concatenate strings. However, it passes the result @@ -1208,8 +1208,8 @@ </BugPattern> <BugPattern type="ISB_EMPTY_STRING_APPENDING"> - <ShortDescription>method concatenates an empty string to effect type conversion</ShortDescription> - <LongDescription>method {1} concatenates an empty string to effect type conversion</LongDescription> + <ShortDescription>Method concatenates an empty string to effect type conversion</ShortDescription> + <LongDescription>Method {1} concatenates an empty string to effect type conversion</LongDescription> <Details> <![CDATA[ <p> This method concatenates an empty string with a literal value, in order to convert @@ -1221,8 +1221,8 @@ </BugPattern> <BugPattern type="SCI_SYNCHRONIZED_COLLECTION_ITERATORS"> - <ShortDescription>method creates iterators on synchronized collections</ShortDescription> - <LongDescription>method {1} creates iterators on synchronized collections</LongDescription> + <ShortDescription>Method creates iterators on synchronized collections</ShortDescription> + <LongDescription>Method {1} creates iterators on synchronized collections</LongDescription> <Details> <![CDATA[ <p> This method uses a synchronized collection, built from Collections.synchronizedXXXX, but accesses it @@ -1233,8 +1233,8 @@ </BugPattern> <BugPattern type="CC_CYCLOMATIC_COMPLEXITY"> - <ShortDescription>method is excessively complex</ShortDescription> - <LongDescription>method {1} is excessively complex</LongDescription> + <ShortDescription>Method is excessively complex</ShortDescription> + <LongDescription>Method {1} is excessively complex</LongDescription> <Details> <![CDATA[ <p> This method has a high cyclomatic complexity figure, which calculates the number of branch @@ -1245,8 +1245,8 @@ </BugPattern> <BugPattern type="OCP_OVERLY_CONCRETE_PARAMETER"> - <ShortDescription>method needlessly defines parameter with concrete classes</ShortDescription> - <LongDescription>method {1} needlessly defines parameter with concrete classes</LongDescription> + <ShortDescription>Method needlessly defines parameter with concrete classes</ShortDescription> + <LongDescription>Method {1} needlessly defines parameter with concrete classes</LongDescription> <Details> <![CDATA[ <p> This method uses concrete classes for parameters when only methods defined in an implemented @@ -1257,8 +1257,8 @@ </BugPattern> <BugPattern type="LII_LIST_INDEXED_ITERATING"> - <ShortDescription>method uses integer based for loops to iterate over a List</ShortDescription> - <LongDescription>method {1} uses integer based for loops to iterate over a List</LongDescription> + <ShortDescription>Method uses integer based for loops to iterate over a List</ShortDescription> + <LongDescription>Method {1} uses integer based for loops to iterate over a List</LongDescription> <Details> <![CDATA[ <p>This method uses an integer based for loop to iterator over a java.util.List, by calling @@ -1270,8 +1270,8 @@ </BugPattern> <BugPattern type="UCC_UNRELATED_COLLECTION_CONTENTS"> - <ShortDescription>method adds unrelated types to collection or array</ShortDescription> - <LongDescription>method {1} adds unrelated types to collection or array</LongDescription> + <ShortDescription>Method adds unrelated types to collection or array</ShortDescription> + <LongDescription>Method {1} adds unrelated types to collection or array</LongDescription> <Details> <![CDATA[ <p>This method adds unrelated objects to a collection or array, requiring careful and brittle @@ -1282,8 +1282,8 @@ </BugPattern> <BugPattern type="DRE_DECLARED_RUNTIME_EXCEPTION"> - <ShortDescription>method declares RuntimeException in throws clause</ShortDescription> - <LongDescription>method {1} declares RuntimeException in throws clause</LongDescription> + <ShortDescription>Method declares RuntimeException in throws clause</ShortDescription> + <LongDescription>Method {1} declares RuntimeException in throws clause</LongDescription> <Details> <![CDATA[ <p>This method declares a RuntimeException derived class in it's throws clause. @@ -1295,8 +1295,8 @@ </BugPattern> <BugPattern type="CE_CLASS_ENVY"> - <ShortDescription>method excessively uses methods of another class</ShortDescription> - <LongDescription>method {1} excessively uses methods of another class</LongDescription> + <ShortDescription>Method excessively uses methods of another class</ShortDescription> + <LongDescription>Method {1} excessively uses methods of another class</LongDescription> <Details> <![CDATA[ <p><em>THIS DETECTOR IS HIGHLY EXPERIMENTAL AND IS LIKELY TO CREATE A LOT OF FUD</em></p> @@ -1309,8 +1309,8 @@ </BugPattern> <BugPattern type="LSC_LITERAL_STRING_COMPARISON"> - <ShortDescription>method makes literal string comparisons passing the literal as an argument</ShortDescription> - <LongDescription>method {1} makes literal string comparisons passing the literal as an argument</LongDescription> + <ShortDescription>Method makes literal string comparisons passing the literal as an argument</ShortDescription> + <LongDescription>Method {1} makes literal string comparisons passing the literal as an argument</LongDescription> <Details> <![CDATA[ <p>This method calls the equals or compareTo methods on a String variable passing in a String literal. @@ -1321,8 +1321,8 @@ </BugPattern> <BugPattern type="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS"> - <ShortDescription>constructor makes call to non-final method</ShortDescription> - <LongDescription>constructor {1} makes call to non-final method</LongDescription> + <ShortDescription>Constructor makes call to non-final method</ShortDescription> + <LongDescription>Constructor {1} makes call to non-final method</LongDescription> <Details> <![CDATA[ <p>This constructor makes a call to a non-final method. Since this method can be overriden, a subclasses @@ -1333,8 +1333,8 @@ </BugPattern> <BugPattern type="DLC_DUBIOUS_LIST_COLLECTION"> - <ShortDescription>class defines List based fields but uses them like Sets</ShortDescription> - <LongDescription>class {0} defines List based fields but uses them like Sets</LongDescription> + <ShortDescription>Class defines List based fields but uses them like Sets</ShortDescription> + <LongDescription>Class {0} defines List based fields but uses them like Sets</LongDescription> <Details> <![CDATA[ <p>This class defines a field based on java.util.List, but uses it to some extent like a Set. Since @@ -1346,8 +1346,8 @@ </BugPattern> <BugPattern type="PL_PARALLEL_LISTS"> - <ShortDescription>class defines two or more one for one associated lists or arrays</ShortDescription> - <LongDescription>class {0} defines two or more one for one associated lists or arrays</LongDescription> + <ShortDescription>Class defines two or more one for one associated lists or arrays</ShortDescription> + <LongDescription>Class {0} defines two or more one for one associated lists or arrays</LongDescription> <Details> <![CDATA[ <p>This class appears to maintain two or more lists or arrays who's contains is related one-for-one @@ -1358,8 +1358,8 @@ </BugPattern> <BugPattern type="FP_FINAL_PARAMETERS"> - <ShortDescription>method does not define a parameter as final, but could</ShortDescription> - <LongDescription>method {1} does not define a parameter as final, but could</LongDescription> + <ShortDescription>Method does not define a parameter as final, but could</ShortDescription> + <LongDescription>Method {1} does not define a parameter as final, but could</LongDescription> <Details> <![CDATA[ <p>This method correctly does not write to a parameter. To help document this, and to perhaps @@ -1370,8 +1370,8 @@ </BugPattern> <BugPattern type="ACEM_ABSTRACT_CLASS_EMPTY_METHODS"> - <ShortDescription>empty method could be declared abstract</ShortDescription> - <LongDescription>empty method {1} could be declared abstract</LongDescription> + <ShortDescription>Empty method could be declared abstract</ShortDescription> + <LongDescription>Empty method {1} could be declared abstract</LongDescription> <Details> <![CDATA[ <p>This method is empty or merely throws an exception. Since the class it is defined in is @@ -1382,8 +1382,8 @@ </BugPattern> <BugPattern type="MAC_MANUAL_ARRAY_COPY"> - <ShortDescription>method copies arrays manually</ShortDescription> - <LongDescription>method {1} copies arrays manually</LongDescription> + <ShortDescription>Method copies arrays manually</ShortDescription> + <LongDescription>Method {1} copies arrays manually</LongDescription> <Details> <![CDATA[ <p>This method copies data from one array to another manually using a loop. @@ -1393,8 +1393,8 @@ </BugPattern> <BugPattern type="FPL_FLOATING_POINT_LOOPS"> - <ShortDescription>method uses floating point indexed loops</ShortDescription> - <LongDescription>method {1} uses floating point indexed loops</LongDescription> + <ShortDescription>Method uses floating point indexed loops</ShortDescription> + <LongDescription>Method {1} uses floating point indexed loops</LongDescription> <Details> <![CDATA[ <p>This method uses floating point variables to index a loop. Since floating point @@ -1406,8 +1406,8 @@ </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> + <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 @@ -1418,8 +1418,8 @@ </BugPattern> <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> + <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 @@ -1430,8 +1430,8 @@ </BugPattern> <BugPattern type="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN"> - <ShortDescription>class has abnormal exit from finally block</ShortDescription> - <LongDescription>class {0} has abnormal exit from finally block</LongDescription> + <ShortDescription>Class has abnormal exit from finally block</ShortDescription> + <LongDescription>Class {0} has abnormal exit from finally block</LongDescription> <Details> <![CDATA[ <p>This class returns or throws exceptions from a finally block. This will @@ -1442,8 +1442,8 @@ </BugPattern> <BugPattern type="SMII_STATIC_METHOD_INSTANCE_INVOCATION"> - <ShortDescription>method calls static method on instance reference</ShortDescription> - <LongDescription>method {1} calls static method on instance reference</LongDescription> + <ShortDescription>Method calls static method on instance reference</ShortDescription> + <LongDescription>Method {1} calls static method on instance reference</LongDescription> <Details> <![CDATA[ <p>This method makes a static method call on an instance reference. For @@ -1456,8 +1456,8 @@ </BugPattern> <BugPattern type="STS_SPURIOUS_THREAD_STATES"> - <ShortDescription>method calls wait, notify or notifyAll on a Thread instance</ShortDescription> - <LongDescription>method {1} calls wait, notify or notifyAll on a Thread instance</LongDescription> + <ShortDescription>Method calls wait, notify or notifyAll on a Thread instance</ShortDescription> + <LongDescription>Method {1} calls wait, notify or notifyAll on a Thread instance</LongDescription> <Details> <![CDATA[ <p>This method invokes the methods wait, notify or notifyAll on a Thread instance. @@ -1470,8 +1470,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_AUTOBOXING_CTOR"> - <ShortDescription>method passes primitive wrapper to same primitive wrapper constructor</ShortDescription> - <LongDescription>method {1} passes primitive wrapper to same primitive wrapper constructor</LongDescription> + <ShortDescription>Method passes primitive wrapper to same primitive wrapper constructor</ShortDescription> + <LongDescription>Method {1} passes primitive wrapper to same primitive wrapper constructor</LongDescription> <Details> <![CDATA[ <p>This method passes a wrapped primitive object to the same class's constructor. @@ -1483,8 +1483,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOXING_STRING_CTOR"> - <ShortDescription>method passes parsed string to primitive wrapper constructor</ShortDescription> - <LongDescription>method {1} passes parsed string to primitive wrapper constructor</LongDescription> + <ShortDescription>Method passes parsed string to primitive wrapper constructor</ShortDescription> + <LongDescription>Method {1} passes parsed string to primitive wrapper constructor</LongDescription> <Details> <![CDATA[ <p>This method passes a primitive value retrieved from a BoxedPrimitive.parseBoxedPrimitive("1") call to @@ -1495,8 +1495,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_AUTOBOXING_VALUEOF"> - <ShortDescription>method passes primitive wrapper to Wrapper class valueOf method</ShortDescription> - <LongDescription>method {1} passes primitive wrapper to Wrapper class valueOf method</LongDescription> + <ShortDescription>Method passes primitive wrapper to Wrapper class valueOf method</ShortDescription> + <LongDescription>Method {1} passes primitive wrapper to Wrapper class valueOf method</LongDescription> <Details> <![CDATA[ <p>This method passes a wrapped primitive object to the same class's .valueOf method. @@ -1508,8 +1508,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOXING_PARSE"> - <ShortDescription>method converts String to primitive using excessive boxing</ShortDescription> - <LongDescription>method {1} converts String to primitive using excessive boxing</LongDescription> + <ShortDescription>Method converts String to primitive using excessive boxing</ShortDescription> + <LongDescription>Method {1} converts String to primitive using excessive boxing</LongDescription> <Details> <![CDATA[ <p>This method passes a String to a wrapped primitive object's valueOf method, which in turn calls @@ -1521,8 +1521,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOXING_VALUEOF"> - <ShortDescription>method converts String to boxed primitive using excessive boxing</ShortDescription> - <LongDescription>method {1} converts String to boxed primitive using excessive boxing</LongDescription> + <ShortDescription>Method converts String to boxed primitive using excessive boxing</ShortDescription> + <LongDescription>Method {1} converts String to boxed primitive using excessive boxing</LongDescription> <Details> <![CDATA[ <p>This method passes a String to a wrapped primitive object's parse method, which in turn calls @@ -1534,8 +1534,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOX_TO_UNBOX"> - <ShortDescription>method creates Boxed primitive from primitive only to get primitive value</ShortDescription> - <LongDescription>method {1} creates Boxed primitive from primitive only to get primitive value</LongDescription> + <ShortDescription>Method creates Boxed primitive from primitive only to get primitive value</ShortDescription> + <LongDescription>Method {1} creates Boxed primitive from primitive only to get primitive value</LongDescription> <Details> <![CDATA[ <p>This method constructs a Boxed Primitive from a primitive only to call the primitiveValue() method to @@ -1553,8 +1553,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOX_TO_CAST"> - <ShortDescription>method creates Boxed primitive from primitive only to cast to another primitive type</ShortDescription> - <LongDescription>method {1} creates Boxed primitive from primitive only to cast to another primitive type</LongDescription> + <ShortDescription>Method creates Boxed primitive from primitive only to cast to another primitive type</ShortDescription> + <LongDescription>Method {1} creates Boxed primitive from primitive only to cast to another primitive type</LongDescription> <Details> <![CDATA[ <p>This method constructs a Boxed Primitive from a primitive only to call the primitiveValue() method to @@ -1572,8 +1572,8 @@ </BugPattern> <BugPattern type="NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION"> - <ShortDescription>method needlessly boxes a boolean constant</ShortDescription> - <LongDescription>method {1} needlessly boxes a boolean constant</LongDescription> + <ShortDescription>Method needlessly boxes a boolean constant</ShortDescription> + <LongDescription>Method {1} needlessly boxes a boolean constant</LongDescription> <Details> <![CDATA[ <p>This method assigns a Boxed boolean constant to a primitive boolean variable, or assigns a primitive boolean @@ -1592,8 +1592,8 @@ </BugPattern> <BugPattern type="USBR_UNNECESSARY_STORE_BEFORE_RETURN"> - <ShortDescription>method stores return result in local before immediately returning it</ShortDescription> - <LongDescription>method {1} stores return result in local before immediately returning it</LongDescription> + <ShortDescription>Method stores return result in local before immediately returning it</ShortDescription> + <LongDescription>Method {1} stores return result in local before immediately returning it</LongDescription> <Details> <![CDATA[ <p>This method stores the return result in a local variable, and then immediately @@ -1605,8 +1605,8 @@ </BugPattern> <BugPattern type="COM_COPIED_OVERRIDDEN_METHOD"> - <ShortDescription>method is implemented with an exact copy of it's superclass's method</ShortDescription> - <LongDescription>method {1} is implemented with an exact copy of it's superclass's method</LongDescription> + <ShortDescription>Method is implemented with an exact copy of it's superclass's method</ShortDescription> + <LongDescription>Method {1} is implemented with an exact copy of it's superclass's method</LongDescription> <Details> <![CDATA[ <p>This method is implemented using an exact copy of it's super class method's @@ -1617,8 +1617,8 @@ </BugPattern> <BugPattern type="ABC_ARRAY_BASED_COLLECTIONS"> - <ShortDescription>method uses array as basis of collection</ShortDescription> - <LongDescription>method {1} uses array as basis of collection</LongDescription> + <ShortDescription>Method uses array as basis of collection</ShortDescription> + <LongDescription>Method {1} uses array as basis of collection</LongDescription> <Details> <![CDATA[ <p>This method passes an array as the key to a Map, element in a Set, or item in a List when @@ -1632,8 +1632,8 @@ </BugPattern> <BugPattern type="ODN_ORPHANED_DOM_NODE"> - <ShortDescription>method creates DOM node but doesn't attach it to a document</ShortDescription> - <LongDescription>method {1} creates DOM node but doesn't attach it to a document</LongDescription> + <ShortDescription>Method creates DOM node but doesn't attach it to a document</ShortDescription> + <LongDescription>Method {1} creates DOM node but doesn't attach it to a document</LongDescription> <Details> <![CDATA[ <p>This method creates a DOM node but does not attach it to a DOM document. @@ -1643,8 +1643,8 @@ </BugPattern> <BugPattern type="AOM_ABSTRACT_OVERRIDDEN_METHOD"> - <ShortDescription>abstract method overrides a concrete implementation</ShortDescription> - <LongDescription>abstract method {1} overrides a concrete implementation</LongDescription> + <ShortDescription>Abstract method overrides a concrete implementation</ShortDescription> + <LongDescription>Abstract method {1} overrides a concrete implementation</LongDescription> <Details> <![CDATA[ <p>This abstract method is derived from a concrete method implementation. It is highly @@ -1655,8 +1655,8 @@ </BugPattern> <BugPattern type="CBX_CUSTOM_BUILT_XML"> - <ShortDescription>method builds xml strings through adhoc concatenation</ShortDescription> - <LongDescription>method {1} builds xml strings through adhoc concatenation</LongDescription> + <ShortDescription>Method builds xml strings through adhoc concatenation</ShortDescription> + <LongDescription>Method {1} builds xml strings through adhoc concatenation</LongDescription> <Details> <![CDATA[ <p>This method generates an xml based string by concatenating together various @@ -1669,8 +1669,8 @@ </BugPattern> <BugPattern type="BSB_BLOATED_SYNCHRONIZED_BLOCK"> - <ShortDescription>method overly synchronizes a block of code</ShortDescription> - <LongDescription>method {1} overly synchronizes a block of code</LongDescription> + <ShortDescription>Method overly synchronizes a block of code</ShortDescription> + <LongDescription>Method {1} overly synchronizes a block of code</LongDescription> <Details> <![CDATA[ <p>This methods implements a synchronized block, but the code found at the beginning @@ -1683,8 +1683,8 @@ </BugPattern> <BugPattern type="CLI_CONSTANT_LIST_INDEX"> - <ShortDescription>method accesses list or array with constant index</ShortDescription> - <LongDescription>method {1} accesses list or array with constant index</LongDescription> + <ShortDescription>Method accesses list or array with constant index</ShortDescription> + <LongDescription>Method {1} accesses list or array with constant index</LongDescription> <Details> <![CDATA[ <p>This method accesses an array or list using a constant integer index. Often, @@ -1696,8 +1696,8 @@ </BugPattern> <BugPattern type="SCR_SLOPPY_CLASS_REFLECTION"> - <ShortDescription>method accesses statically bound class with Class.forName</ShortDescription> - <LongDescription>method {1} accesses statically bound class with Class.forName</LongDescription> + <ShortDescription>Method accesses statically bound class with Class.forName</ShortDescription> + <LongDescription>Method {1} accesses statically bound class with Class.forName</LongDescription> <Details> <![CDATA[ <p>This method accesses the class object of a class that is already statically bound @@ -1709,8 +1709,8 @@ </BugPattern> <BugPattern type="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE"> - <ShortDescription>method uses 1 element array to simulate call by reference</ShortDescription> - <LongDescription>method {1} uses 1 element array to simulate call by reference</LongDescription> + <ShortDescription>Method uses 1 element array to simulate call by reference</ShortDescription> + <LongDescription>Method {1} uses 1 element array to simulate call by reference</LongDescription> <Details> <![CDATA[ <p>This method uses a one element array to wrap an object that is to be passed to a method as an argument @@ -1721,8 +1721,8 @@ </BugPattern> <BugPattern type="SG_SLUGGISH_GUI"> - <ShortDescription>method performs time consuming operation in gui thread</ShortDescription> - <LongDescription>method {1} performs time consuming operation in gui thread</LongDescription> + <ShortDescription>Method performs time consuming operation in gui thread</ShortDescription> + <LongDescription>Method {1} performs time consuming operation in gui thread</LongDescription> <Details> <![CDATA[ <p>This method implements an awt or swing listener and performs time @@ -1735,8 +1735,8 @@ </BugPattern> <BugPattern type="NIR_NEEDLESS_INSTANCE_RETRIEVAL"> - <ShortDescription>method retrieves instance to load static member</ShortDescription> - <LongDescription>method {1} retrieves instance to load static member</LongDescription> + <ShortDescription>Method retrieves instance to load static member</ShortDescription> + <LongDescription>Method {1} retrieves instance to load static member</LongDescription> <Details> <![CDATA[ <p>This method calls a method to load a reference to an object, and then only @@ -1781,8 +1781,8 @@ </BugPattern> <BugPattern type="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT"> - <ShortDescription>method calls wait when await was probably intended</ShortDescription> - <LongDescription>method {1} calls wait when await was probably intended</LongDescription> + <ShortDescription>Method calls wait when await was probably intended</ShortDescription> + <LongDescription>Method {1} calls wait when await was probably intended</LongDescription> <Details> <![CDATA[ <p>This method calls wait() on a on mutex defined in the java.util.concurrent package. @@ -1793,8 +1793,8 @@ </BugPattern> <BugPattern type="JVR_JDBC_VENDOR_RELIANCE"> - <ShortDescription>method uses jdbc vendor specific classes and methods</ShortDescription> - <LongDescription>method {1} uses jdbc vendor specific classes and methods</LongDescription> + <ShortDescription>Method uses jdbc vendor specific classes and methods</ShortDescription> + <LongDescription>Method {1} uses jdbc vendor specific classes and methods</LongDescription> <Details> <![CDATA[ <p>This method uses jdbc vendor specific classes and method to perform database work. @@ -1804,8 +1804,8 @@ </BugPattern> <BugPattern type="PMB_POSSIBLE_MEMORY_BLOAT"> - <ShortDescription>class defines static field that appears to allow memory bloat</ShortDescription> - <LongDescription>class {0} defines static field that appears to allow memory bloat</LongDescription> + <ShortDescription>Class defines static field that appears to allow memory bloat</ShortDescription> + <LongDescription>Class {0} defines static field that appears to allow memory bloat</LongDescription> <Details> <![CDATA[ <p>This class defines static fields that are collections or StringBuffers that do not @@ -1816,8 +1816,8 @@ </BugPattern> <BugPattern type="LSYC_LOCAL_SYNCHRONIZED_COLLECTION"> - <ShortDescription>method creates local variable-based synchronized collection</ShortDescription> - <LongDescription>method {1} creates local variable-based synchronized collection</LongDescription> + <ShortDescription>Method creates local variable-based synchronized collection</ShortDescription> + <LongDescription>Method {1} creates local variable-based synchronized collection</LongDescription> <Details> <![CDATA[ <p>This method creates a synchronized collection and store the reference to it @@ -1836,8 +1836,8 @@ </BugPattern> <BugPattern type="FCBL_FIELD_COULD_BE_LOCAL"> - <ShortDescription>class defines fields that are used only as locals</ShortDescription> - <LongDescription>class {0} defines fields that are used only as locals</LongDescription> + <ShortDescription>Class defines fields that are used only as locals</ShortDescription> + <LongDescription>Class {0} defines fields that are used only as locals</LongDescription> <Details> <![CDATA[ <p>This class defines fields that are used in a locals only fashion, @@ -1849,8 +1849,8 @@ </BugPattern> <BugPattern type="NOS_NON_OWNED_SYNCHRONIZATION"> - <ShortDescription>class uses non owned variables to synchronize on</ShortDescription> - <LongDescription>class {0} uses non owned variables to synchronize on</LongDescription> + <ShortDescription>Class uses non owned variables to synchronize on</ShortDescription> + <LongDescription>Class {0} uses non owned variables to synchronize on</LongDescription> <Details> <![CDATA[ <p>This method uses a synchronize block where the object that is being synchronized on, @@ -2381,8 +2381,8 @@ </BugPattern> <BugPattern type="SPP_USELESS_CASING"> - <ShortDescription>method compares string without case after enforcing a case</ShortDescription> - <LongDescription>method {1} compares string without case after enforcing a case</LongDescription> + <ShortDescription>Method compares string without case after enforcing a case</ShortDescription> + <LongDescription>Method {1} compares string without case after enforcing a case</LongDescription> <Details> <![CDATA[ This method compares two strings with compareToIgnoreCase or equalsIgnoreCase, after having @@ -2393,8 +2393,8 @@ </BugPattern> <BugPattern type="SPP_NON_ARRAY_PARM"> - <ShortDescription>method passes a non array object to a parameter that expects an array</ShortDescription> - <LongDescription>method {1} passes a non array object to a parameter that expects an array</LongDescription> + <ShortDescription>Method passes a non array object to a parameter that expects an array</ShortDescription> + <LongDescription>Method {1} passes a non array object to a parameter that expects an array</LongDescription> <Details> <![CDATA[ This method expects an array to be passed as one of its parameters, but unfortunately defines @@ -2482,8 +2482,8 @@ </BugPattern> <BugPattern type="SJVU_SUSPICIOUS_JDK_VERSION_USE"> - <ShortDescription>method uses rt.jar class or method that does not exist</ShortDescription> - <LongDescription>method {1} uses rt.jar class or method that does not exist for the version the class is compiled for</LongDescription> + <ShortDescription>Method uses rt.jar class or method that does not exist</ShortDescription> + <LongDescription>Method {1} uses rt.jar class or method that does not exist for the version the class is compiled for</LongDescription> <Details> <![CDATA[ <p>This method calls a method that does not exist, on a class that does not exist in the jdk that @@ -2494,8 +2494,8 @@ </BugPattern> <BugPattern type="UAA_USE_ADD_ALL"> - <ShortDescription>method uses simple loop to copy contents of one collection to another</ShortDescription> - <LongDescription>method {1} uses simple loop to copy contents of one collection to another</LongDescription> + <ShortDescription>Method uses simple loop to copy contents of one collection to another</ShortDescription> + <LongDescription>Method {1} uses simple loop to copy contents of one collection to another</LongDescription> <Details> <![CDATA[ <p>This method uses a simple for loop to copy the contents of a set, list, map key/value, array or other collection @@ -2507,8 +2507,8 @@ </BugPattern> <BugPattern type="MRC_METHOD_RETURNS_CONSTANT"> - <ShortDescription>private method only returns one constant value</ShortDescription> - <LongDescription>private method {1} only returns one constant value</LongDescription> + <ShortDescription>Private method only returns one constant value</ShortDescription> + <LongDescription>Private method {1} only returns one constant value</LongDescription> <Details> <![CDATA[ <p>This private or static method only returns one constant value. As this method is private or static, @@ -2520,8 +2520,8 @@ </BugPattern> <BugPattern type="NCS_NEEDLESS_CUSTOM_SERIALIZATION"> - <ShortDescription>method needlessly implements what is default streaming behavior</ShortDescription> - <LongDescription>method {1} needlessly implements what is default streaming behavior</LongDescription> + <ShortDescription>Method needlessly implements what is default streaming behavior</ShortDescription> + <LongDescription>Method {1} needlessly implements what is default streaming behavior</LongDescription> <Details> <![CDATA[ <p>This method implements the Serializable interface by performing the same operations that @@ -2531,8 +2531,8 @@ </BugPattern> <BugPattern type="MOM_MISLEADING_OVERLOAD_MODEL"> - <ShortDescription>class 'overloads' a method with both instance and static versions</ShortDescription> - <LongDescription>class {0} 'overloads' a method with both instance and static versions</LongDescription> + <ShortDescription>Class 'overloads' a method with both instance and static versions</ShortDescription> + <LongDescription>Class {0} 'overloads' a method with both instance and static versions</LongDescription> <Details> <![CDATA[ <p>This class 'overloads' the same method with both an instance and static version. As the use @@ -2542,8 +2542,8 @@ </BugPattern> <BugPattern type="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS"> - <ShortDescription>unconstrained method converts checked exception to unchecked</ShortDescription> - <LongDescription>unconstrained method {1} converts checked exception to unchecked</LongDescription> + <ShortDescription>Unconstrained method converts checked exception to unchecked</ShortDescription> + <LongDescription>Unconstrained method {1} converts checked exception to unchecked</LongDescription> <Details> <![CDATA[ <p>This method is not constrained by an interface or superclass, but converts a caught checked exception @@ -2554,8 +2554,8 @@ </BugPattern> <BugPattern type="EXS_EXCEPTION_SOFTENING_HAS_CHECKED"> - <ShortDescription>constrained method converts checked exception to unchecked instead of another allowable checked exception</ShortDescription> - <LongDescription>constrained method {1} converts checked exception to unchecked instead of another allowable checked exception</LongDescription> + <ShortDescription>Constrained method converts checked exception to unchecked instead of another allowable checked exception</ShortDescription> + <LongDescription>Constrained method {1} converts checked exception to unchecked instead of another allowable checked exception</LongDescription> <Details> <![CDATA[ <p>This method's exception signature is constrained by an interface of super class to not throw a @@ -2567,8 +2567,8 @@ </BugPattern> <BugPattern type="EXS_EXCEPTION_SOFTENING_NO_CHECKED"> - <ShortDescription>constrained method converts checked exception to unchecked</ShortDescription> - <LongDescription>constrained method {1} converts checked exception to unchecked</LongDescription> + <ShortDescription>Constrained method converts checked exception to unchecked</ShortDescription> + <LongDescription>Constrained method {1} converts checked exception to unchecked</LongDescription> <Details> <![CDATA[ <p>This method's exception signature is constrained by an interface or super class to not throw @@ -2580,8 +2580,8 @@ </BugPattern> <BugPattern type="CFS_CONFUSING_FUNCTION_SEMANTICS"> - <ShortDescription>method returns modified parameter</ShortDescription> - <LongDescription>method {1} returns modified parameter</LongDescription> + <ShortDescription>Method returns modified parameter</ShortDescription> + <LongDescription>Method {1} returns modified parameter</LongDescription> <Details> <![CDATA[ <p>This method appears to modify a parameter, and then return this parameter as the @@ -2595,8 +2595,8 @@ </BugPattern> <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT"> - <ShortDescription>method passes constant to second (actual) assertion parameter</ShortDescription> - <LongDescription>method {1} passes constant to second (actual) assertion parameter</LongDescription> + <ShortDescription>Method passes constant to second (actual) assertion parameter</ShortDescription> + <LongDescription>Method {1} passes constant to second (actual) assertion parameter</LongDescription> <Details> <![CDATA[ <p>This method calls assert passing a constant value as the second of the two values. The assert @@ -2607,8 +2607,8 @@ </BugPattern> <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE"> - <ShortDescription>method asserts that two doubles are exactly equal</ShortDescription> - <LongDescription>method {1} asserts that two doubles are exactly equal</LongDescription> + <ShortDescription>Method asserts that two doubles are exactly equal</ShortDescription> + <LongDescription>Method {1} asserts that two doubles are exactly equal</LongDescription> <Details> <![CDATA[ <p>This method calls assert with two doubles or Doubles. Due to the inprecision of doubles, you @@ -2618,8 +2618,8 @@ </BugPattern> <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT"> - <ShortDescription>method asserts that a value is true or false</ShortDescription> - <LongDescription>method {1} asserts that a value is true or false</LongDescription> + <ShortDescription>Method asserts that a value is true or false</ShortDescription> + <LongDescription>Method {1} asserts that a value is true or false</LongDescription> <Details> <![CDATA[ <p>This method asserts that a value is equal to true or false. It is simpler to just @@ -2629,8 +2629,8 @@ </BugPattern> <BugPattern type="JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL"> - <ShortDescription>method asserts that an auto-boxed value is not null</ShortDescription> - <LongDescription>method {1} asserts that an auto-boxed value is not null</LongDescription> + <ShortDescription>Method asserts that an auto-boxed value is not null</ShortDescription> + <LongDescription>Method {1} asserts that an auto-boxed value is not null</LongDescription> <Details> <![CDATA[ <p>This method asserts that a primitive value that was autoboxed into a boxed primitive was not @@ -2641,8 +2641,8 @@ </BugPattern> <BugPattern type="SCA_SUSPICIOUS_CLONE_ALGORITHM"> - <ShortDescription>clone method stores a new value to member field of source object</ShortDescription> - <LongDescription>clone method {1} stores a new value to member field of source object</LongDescription> + <ShortDescription>Clone method stores a new value to member field of source object</ShortDescription> + <LongDescription>Clone method {1} stores a new value to member field of source object</LongDescription> <Details> <![CDATA[ <p>The clone method stores a value to a member field of the source object. Normally, all @@ -2652,8 +2652,8 @@ </BugPattern> <BugPattern type="WEM_WEAK_EXCEPTION_MESSAGING"> - <ShortDescription>method throws exception with static message string</ShortDescription> - <LongDescription>method {1} throws exception with static message string</LongDescription> + <ShortDescription>Method throws exception with static message string</ShortDescription> + <LongDescription>Method {1} throws exception with static message string</LongDescription> <Details> <![CDATA[ <p>This method creates and throws an exception using a static string as the exceptions message. @@ -2665,8 +2665,8 @@ </BugPattern> <BugPattern type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT"> - <ShortDescription>method modifies http session attribute without calling setAttribute</ShortDescription> - <LongDescription>method {1} modifies http session attribute without calling setAttribute</LongDescription> + <ShortDescription>Method modifies http session attribute without calling setAttribute</ShortDescription> + <LongDescription>Method {1} modifies http session attribute without calling setAttribute</LongDescription> <Details> <![CDATA[ <p>This method fetches a complex object from an HttpSession object, modifies this object, but does @@ -2678,8 +2678,8 @@ </BugPattern> <BugPattern type="LO_SUSPECT_LOG_CLASS"> - <ShortDescription>method specifies an unrelated class when allocating a Logger</ShortDescription> - <LongDescription>method {1} specifies an unrelated class when allocating a Logger</LongDescription> + <ShortDescription>Method specifies an unrelated class when allocating a Logger</ShortDescription> + <LongDescription>Method {1} specifies an unrelated class when allocating a Logger</LongDescription> <Details> <![CDATA[ <p>This method creates a Logger by passing in a specification for a class that is unrelated @@ -2689,8 +2689,8 @@ </BugPattern> <BugPattern type="LO_SUSPECT_LOG_PARAMETER"> - <ShortDescription>constructor declares a Logger parameter</ShortDescription> - <LongDescription>constructor {1} declares a Logger parameter</LongDescription> + <ShortDescription>Constructor declares a Logger parameter</ShortDescription> + <LongDescription>Constructor {1} declares a Logger parameter</LongDescription> <Details> <![CDATA[ <p>This constructor declares a parameter that is a Logger. As loggers are meant to be @@ -2701,8 +2701,8 @@ </BugPattern> <BugPattern type="LO_STUTTERED_MESSAGE"> - <ShortDescription>method stutters exception message in logger</ShortDescription> - <LongDescription>method {1} stutters exception message in logger</LongDescription> + <ShortDescription>Method stutters exception message in logger</ShortDescription> + <LongDescription>Method {1} stutters exception message in logger</LongDescription> <Details> <![CDATA[ This method uses a logger method that takes an exception, and passes the result of @@ -2716,8 +2716,8 @@ </BugPattern> <BugPattern type="IICU_INCORRECT_INTERNAL_CLASS_USE"> - <ShortDescription>class relies on internal api classes</ShortDescription> - <LongDescription>class {0} relies on internal api classes</LongDescription> + <ShortDescription>Class relies on internal api classes</ShortDescription> + <LongDescription>Class {0} relies on internal api classes</LongDescription> <Details> <![CDATA[ <p>This class makes use of internal api classes. As these @@ -2734,8 +2734,8 @@ </BugPattern> <BugPattern type="DSOC_DUBIOUS_SET_OF_COLLECTIONS"> - <ShortDescription>method uses a set of collections</ShortDescription> - <LongDescription>method {1} uses a set of collections</LongDescription> + <ShortDescription>Method uses a set of collections</ShortDescription> + <LongDescription>Method {1} uses a set of collections</LongDescription> <Details> <![CDATA[ <p>This method creates a set that contains other collections, or a Map whose keySet is @@ -2753,8 +2753,8 @@ </BugPattern> <BugPattern type="BED_BOGUS_EXCEPTION_DECLARATION"> - <ShortDescription>non derivable method declares throwing an exception that isn't thrown</ShortDescription> - <LongDescription>non derivable method {1} declares throwing an exception that isn't thrown</LongDescription> + <ShortDescription>Non derivable method declares throwing an exception that isn't thrown</ShortDescription> + <LongDescription>Non derivable method {1} declares throwing an exception that isn't thrown</LongDescription> <Details> <![CDATA[ <p>This method declares that it throws a checked exception that it does not throw. As this method is @@ -2766,8 +2766,8 @@ </BugPattern> <BugPattern type="UNNC_UNNECESSARY_NEW_NULL_CHECK"> - <ShortDescription>method checks the result of a new allocation</ShortDescription> - <LongDescription>method {1} checks the result of a new allocation</LongDescription> + <ShortDescription>Method checks the result of a new allocation</ShortDescription> + <LongDescription>Method {1} checks the result of a new allocation</LongDescription> <Details> <![CDATA[ <p>This method allocations an object with new, and then checks that the object is null @@ -2778,8 +2778,8 @@ </BugPattern> <BugPattern type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN"> - <ShortDescription>class appears to implement the old style type safe enum pattern</ShortDescription> - <LongDescription>class {0} appears to implement the old style type safe enum pattern</LongDescription> + <ShortDescription>Class appears to implement the old style type safe enum pattern</ShortDescription> + <LongDescription>Class {0} appears to implement the old style type safe enum pattern</LongDescription> <Details> <![CDATA[ <p>This class appears to implement the old style type safe enum pattern that was used in place of @@ -2790,8 +2790,8 @@ </BugPattern> <BugPattern type="SMA_STUTTERED_METHOD_ARGUMENTS"> - <ShortDescription>code calls a method passing the same value to two different arguments</ShortDescription> - <LongDescription>code {1} calls a method passing the same value to two different arguments</LongDescription> + <ShortDescription>Code calls a method passing the same value to two different arguments</ShortDescription> + <LongDescription>Code {1} calls a method passing the same value to two different arguments</LongDescription> <Details> <![CDATA[ <p>This method calls a method passing the same value for two or more of the parameters. @@ -2803,8 +2803,8 @@ </BugPattern> <BugPattern type="TBP_TRISTATE_BOOLEAN_PATTERN"> - <ShortDescription>method returns null for Boolean type</ShortDescription> - <LongDescription>method {1} returns null for Boolean type</LongDescription> + <ShortDescription>Method returns null for Boolean type</ShortDescription> + <LongDescription>Method {1} returns null for Boolean type</LongDescription> <Details> <![CDATA[ <p>This method declares that it returns a Boolean value. However the code @@ -2817,8 +2817,8 @@ </BugPattern> <BugPattern type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY"> - <ShortDescription>method returns an array that appears not to be initialized</ShortDescription> - <LongDescription>method {1} returns an array that appears not to be initialized</LongDescription> + <ShortDescription>Method returns an array that appears not to be initialized</ShortDescription> + <LongDescription>Method {1} returns an array that appears not to be initialized</LongDescription> <Details> <![CDATA[ <p>This method returns an array that was allocated but apparently not initialized. It is @@ -2830,8 +2830,8 @@ </BugPattern> <BugPattern type="ITU_INAPPROPRIATE_TOSTRING_USE"> - <ShortDescription>method performs algorithmic operations on the result of a toString() call</ShortDescription> - <LongDescription>method {1} performs algorithmic operations on the result of a toString() call</LongDescription> + <ShortDescription>Method performs algorithmic operations on the result of a toString() call</ShortDescription> + <LongDescription>Method {1} performs algorithmic operations on the result of a toString() call</LongDescription> <Details> <![CDATA[ <p>This method calls algorithmic operations on a String that was returned from a toString() method. @@ -2841,8 +2841,8 @@ </BugPattern> <BugPattern type="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING"> - <ShortDescription>method uses the same HttpSession attribute name but with different casing</ShortDescription> - <LongDescription>method {1} uses the same HttpSession attribute name but with different casing</LongDescription> + <ShortDescription>Method uses the same HttpSession attribute name but with different casing</ShortDescription> + <LongDescription>Method {1} uses the same HttpSession attribute name but with different casing</LongDescription> <Details> <![CDATA[ <p>This method sets or gets an HttpSession attribute with a parmeter name that was used in other locations @@ -2852,8 +2852,8 @@ </BugPattern> <BugPattern type="IKNC_INCONSISTENT_HTTP_PARAM_CASING"> - <ShortDescription>method uses the same HttpRequest parameter name but with different casing</ShortDescription> - <LongDescription>method {1} uses the same HttpRequest parameter name but with different casing</LongDescription> + <ShortDescription>Method uses the same HttpRequest parameter name but with different casing</ShortDescription> + <LongDescription>Method {1} uses the same HttpRequest parameter name but with different casing</LongDescription> <Details> <![CDATA[ <p>This method fetches an HttpServletRequest parameter with a parmeter name that was used in other locations @@ -2863,8 +2863,8 @@ </BugPattern> <BugPattern type="OC_OVERZEALOUS_CASTING"> - <ShortDescription>method manually casts the right hand side of an assignment more specifically than needed</ShortDescription> - <LongDescription>method {1} manually casts the right hand side of an assignment more specifically than needed</LongDescription> + <ShortDescription>Method manually casts the right hand side of an assignment more specifically than needed</ShortDescription> + <LongDescription>Method {1} manually casts the right hand side of an assignment more specifically than needed</LongDescription> <Details> <![CDATA[ <p>This method casts the right hand side of an expression to a class that is more specific than the @@ -2875,8 +2875,8 @@ </BugPattern> <BugPattern type="PDP_POORLY_DEFINED_PARAMETER"> - <ShortDescription>method defines parameters more abstractly than needed to function properly</ShortDescription> - <LongDescription>method {1} defines parameters more abstractly than needed to function properly</LongDescription> + <ShortDescription>Method defines parameters more abstractly than needed to function properly</ShortDescription> + <LongDescription>Method {1} defines parameters more abstractly than needed to function properly</LongDescription> <Details> <![CDATA[ <p>This method defines parameters at a more abstract level than is actually needed to function correctly, @@ -2901,8 +2901,8 @@ </BugPattern> <BugPattern type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT"> - <ShortDescription>method performs a contravariant array assignment</ShortDescription> - <LongDescription>method {1} performs a contravariant array assignment</LongDescription> + <ShortDescription>Method performs a contravariant array assignment</ShortDescription> + <LongDescription>Method {1} performs a contravariant array assignment</LongDescription> <Details> <![CDATA[ <p>This method contains a contravariant array assignment. Since arrays are mutable data structures, their use @@ -2920,8 +2920,8 @@ </BugPattern> <BugPattern type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT"> - <ShortDescription>method performs a contravariant array element assignment</ShortDescription> - <LongDescription>method {1} performs a contravariant array element assignment</LongDescription> + <ShortDescription>Method performs a contravariant array element assignment</ShortDescription> + <LongDescription>Method {1} performs a contravariant array element assignment</LongDescription> <Details> <![CDATA[ <p>This method contains a contravariant array element assignment. Since arrays are mutable @@ -2940,8 +2940,8 @@ </BugPattern> <BugPattern type="NFF_NON_FUNCTIONAL_FIELD"> - <ShortDescription>serializable class defines a final transient field</ShortDescription> - <LongDescription>serializable class {0} defines a final transient field</LongDescription> + <ShortDescription>Serializable class defines a final transient field</ShortDescription> + <LongDescription>Serializable class {0} defines a final transient field</LongDescription> <Details> <![CDATA[ <p>This serializable class defines a field as both transient and final. As transient fields @@ -2953,8 +2953,8 @@ </BugPattern> <BugPattern type="SNG_SUSPICIOUS_NULL_FIELD_GUARD"> - <ShortDescription>method tests a field for null as guard for code that doesn't use it</ShortDescription> - <LongDescription>method {1} tests a field for null as guard for code that doesn't use it</LongDescription> + <ShortDescription>Method tests a field for null as guard for code that doesn't use it</ShortDescription> + <LongDescription>Method {1} tests a field for null as guard for code that doesn't use it</LongDescription> <Details> <![CDATA[ <p>This method tests a field to make sure it's not null before executing a conditional block of @@ -2966,8 +2966,8 @@ </BugPattern> <BugPattern type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD"> - <ShortDescription>method tests a local variable for null as guard for code that doesn't use it</ShortDescription> - <LongDescription>method {1} tests a local variable for null as guard for code that doesn't use it</LongDescription> + <ShortDescription>Method tests a local variable for null as guard for code that doesn't use it</ShortDescription> + <LongDescription>Method {1} tests a local variable for null as guard for code that doesn't use it</LongDescription> <Details> <![CDATA[ <p>This method tests a local variable to make sure it's not null before executing a conditional block of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-11 15:42:02
|
Revision: 1610 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1610&view=rev Author: dbrosius Date: 2010-09-11 15:41:55 +0000 (Sat, 11 Sep 2010) Log Message: ----------- add LO_STUTTERED_MESSAGE to LoggerOddities Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/samples/LO_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-09-10 13:02:35 UTC (rev 1609) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-11 15:41:55 UTC (rev 1610) @@ -165,7 +165,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER,LO_STUTTERED_MESSAGE" /> <Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" /> @@ -331,6 +331,7 @@ <BugPattern abbrev="SCSS" type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" category="CORRECTNESS" /> <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_CLASS" category="CORRECTNESS" /> <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_PARAMETER" category="CORRECTNESS" /> + <BugPattern abbrev="LO" type="LO_STUTTERED_MESSAGE" category="STYLE" /> <BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" /> <BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" /> <BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-10 13:02:35 UTC (rev 1609) +++ trunk/fb-contrib/etc/messages.xml 2010-09-11 15:41:55 UTC (rev 1610) @@ -882,7 +882,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities"> <Details> <![CDATA[ - <p>Looks for odd patterns of use of Logger classes from either log4j or slf4j.</p> + <p>Looks for odd patterns of use of Logger classes from either log4j, slf4j or commons logging.</p> <p>It is a fast detector</p> ]]> </Details> @@ -2699,6 +2699,21 @@ ]]> </Details> </BugPattern> + + <BugPattern type="LO_STUTTERED_MESSAGE"> + <ShortDescription>method stutters exception message in logger</ShortDescription> + <LongDescription>method {1} stutters exception message in logger</LongDescription> + <Details> + <![CDATA[ + This method uses a logger method that takes an exception, and passes the result of + the getMessage() method on the exception that occurred as the log message. + Since you are already passing in the exception, that message is already present in the + logs, and by passing it in as the message, you are just stuttering information. + It would be more helpful to provide a hand written message that describes the error in + this method, possibly including the values of key variables. + ]]> + </Details> + </BugPattern> <BugPattern type="IICU_INCORRECT_INTERNAL_CLASS_USE"> <ShortDescription>class relies on internal api classes</ShortDescription> Modified: trunk/fb-contrib/samples/LO_Sample.java =================================================================== --- trunk/fb-contrib/samples/LO_Sample.java 2010-09-10 13:02:35 UTC (rev 1609) +++ trunk/fb-contrib/samples/LO_Sample.java 2010-09-11 15:41:55 UTC (rev 1610) @@ -1,3 +1,8 @@ +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; + import org.apache.log4j.Logger; @@ -11,4 +16,22 @@ { } + + public void testStutter() throws IOException + { + InputStream is = null; + try + { + File f = new File("Foo"); + is = new FileInputStream(f); + } + catch (Exception e) + { + l1.error(e.getMessage(), e); + } + finally + { + is.close(); + } + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2010-09-10 13:02:35 UTC (rev 1609) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2010-09-11 15:41:55 UTC (rev 1610) @@ -18,11 +18,16 @@ */ package com.mebigfatguy.fbcontrib.detect; +import java.util.HashSet; +import java.util.Set; + +import org.apache.bcel.Repository; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.Constant; import org.apache.bcel.classfile.ConstantClass; import org.apache.bcel.classfile.ConstantPool; import org.apache.bcel.classfile.ConstantUtf8; +import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; @@ -33,6 +38,24 @@ import edu.umd.cs.findbugs.ba.ClassContext; public class LoggerOddities extends BytecodeScanningDetector { + private static JavaClass THROWABLE_CLASS; + private static Set<String> loggerMethods; + + static { + try { + THROWABLE_CLASS = Repository.lookupClass("java/lang/Throwable"); + + loggerMethods = new HashSet<String>(); + loggerMethods.add("trace"); + loggerMethods.add("debug"); + loggerMethods.add("info"); + loggerMethods.add("warn"); + loggerMethods.add("error"); + loggerMethods.add("fatal"); + } catch (ClassNotFoundException cnfe) { + THROWABLE_CLASS = null; + } + } private final BugReporter bugReporter; private OpcodeStack stack; private String clsName; @@ -111,6 +134,8 @@ @Override public void sawOpcode(int seen) { String ldcClassName = null; + int exMessageReg = -1; + try { if ((seen == LDC) || (seen == LDC_W)) { Constant c = getConstantRefOperand(); @@ -198,7 +223,42 @@ } } } + } else if (((seen == INVOKEVIRTUAL) || (seen == INVOKEINTERFACE)) && (THROWABLE_CLASS != null)) { + String mthName = getNameConstantOperand(); + if (mthName.equals("getMessage")) { + String callingClsName = getClassConstantOperand(); + JavaClass cls = Repository.lookupClass(callingClsName); + if (cls.instanceOf(THROWABLE_CLASS)) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item exItem = stack.getStackItem(0); + exMessageReg = exItem.getRegisterNumber(); + } + } + } else if (loggerMethods.contains(mthName)) { + String callingClsName = getClassConstantOperand(); + if (callingClsName.endsWith("Log") || (callingClsName.endsWith("Logger"))) { + String sig = getSigConstantOperand(); + if ("(Ljava/lang/String;Ljava/lang/Throwable;)V".equals(sig) || "(Ljava/lang/Object;Ljava/lang/Throwable;)V".equals(sig)) { + if (stack.getStackDepth() >= 2) { + OpcodeStack.Item exItem = stack.getStackItem(0); + OpcodeStack.Item msgItem = stack.getStackItem(1); + + Integer exReg = (Integer)msgItem.getUserValue(); + if (exReg != null) { + if (exReg.intValue() == exItem.getRegisterNumber()) { + bugReporter.reportBug(new BugInstance(this, "LO_STUTTERED_MESSAGE", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + } + } + } + } + } } + } catch (ClassNotFoundException cnfe) { + bugReporter.reportMissingClass(cnfe); } finally { stack.sawOpcode(this, seen); if (ldcClassName != null) { @@ -207,6 +267,12 @@ item.setUserValue(ldcClassName); } } + if (exMessageReg >= 0) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + item.setUserValue(Integer.valueOf(exMessageReg)); + } + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-10 13:02:42
|
Revision: 1609 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1609&view=rev Author: dbrosius Date: 2010-09-10 13:02:35 +0000 (Fri, 10 Sep 2010) Log Message: ----------- capitalize bug descriptions Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-09-10 01:25:50 UTC (rev 1608) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-10 13:02:35 UTC (rev 1609) @@ -195,7 +195,7 @@ <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> --> <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" />--> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-10 01:25:50 UTC (rev 1608) +++ trunk/fb-contrib/etc/messages.xml 2010-09-10 13:02:35 UTC (rev 1609) @@ -484,7 +484,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat"> <Details> <![CDATA[ - <p>looks for classes that maintain collections or StringBuffer/StringBuilders in + <p>Looks for classes that maintain collections or StringBuffer/StringBuilders in static member variables, and that do not appear to provide a way to clear or remove items from these members. Such class fields are likely causes of memory bloat.</p> <p>It is a fast detector</p> @@ -495,7 +495,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection"> <Details> <![CDATA[ - <p>looks for allocations of synchronized collections that are stored in local + <p>Looks for allocations of synchronized collections that are stored in local variables, and never stored in fields or returned from methods. As local variables are by definition thread safe, using synchronized collections in this context makes no sense.</p> @@ -507,7 +507,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal"> <Details> <![CDATA[ - <p>looks for classes that define fields that are used in a locals only fashion, + <p>Looks for classes that define fields that are used in a locals only fashion, specifically private fields that are accessed first in each method with a store vs. a load.</p> <p>It is a slow detector</p> @@ -518,7 +518,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonOwnedSynchronization"> <Details> <![CDATA[ - <p>looks for methods that synchronize on variables that are not owned by the + <p>Looks for methods that synchronize on variables that are not owned by the current class. Doing this causes confusion when two classes use the same variable for their own synchronization purposes. For cleanest separation of interests, only synchronize on private fields of the class. Note that 'this' is not owned by @@ -531,7 +531,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonRecycleableTaglibs"> <Details> <![CDATA[ - <p>looks for tag libraries that are not recycleable because backing members + <p>Looks for tag libraries that are not recycleable because backing members of taglib attributes are set in areas besides the setter method for the attribute.</p> <p>It is a fast detector</p> ]]> @@ -541,7 +541,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.Section508Compliance"> <Details> <![CDATA[ - <p>looks for violation of Section 508, Accessibility for People with disabilities Act. + <p>Looks for violation of Section 508, Accessibility for People with disabilities Act. </p> <p>It is a fast detector</p> ]]> @@ -551,7 +551,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseEnumCollections"> <Details> <![CDATA[ - <p>looks for use of sets and maps using enums. It is more efficient to use EnumSet or EnumMap</p> + <p>Looks for use of sets and maps using enums. It is more efficient to use EnumSet or EnumMap</p> <p>It is a fast detector</p> ]]> </Details> @@ -560,7 +560,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SQLInLoop"> <Details> <![CDATA[ - <p>looks for the execution of sql queries inside a loop. This pattern tends to be inefficient, + <p>Looks for the execution of sql queries inside a loop. This pattern tends to be inefficient, and often can be improved upon, by collecting all the keys needed for the query and issuing just one query using an in clause with all the keys for all the queries previously needed in the loop.</p> <p>It is a fast detector</p> @@ -571,7 +571,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessMemberCollectionSynchronization"> <Details> <![CDATA[ - <p>looks for classes that define private synchronized collections as static or instance + <p>Looks for classes that define private synchronized collections as static or instance members, that are only altered in a static initializer or constructor. Since the multithreaded use of this collection is read-only, the use of synchronization is unnecessary.</p> <p>It is a moderately fast detector</p> @@ -582,7 +582,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InheritanceTypeChecking"> <Details> <![CDATA[ - <p>looks for if/else blocks where a series of them use instanceof on the same + <p>Looks for if/else blocks where a series of them use instanceof on the same variable to determine what to do. If these classes are related by inheritance, this often is better handled through calling a single overridden method.</p> <p>It is a moderately fast detector</p> @@ -593,7 +593,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StaticArrayCreatedInMethod"> <Details> <![CDATA[ - <p>looks for creation of arrays in methods using constant values. These arrays + <p>Looks for creation of arrays in methods using constant values. These arrays will need to be recreated each time the method is called. These arrays should probably be defined as static fields, instead</p> <p>It is a fast detector</p> @@ -604,7 +604,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossiblyRedundantMethodCalls"> <Details> <![CDATA[ - <p>looks for calls of the same method on the same object when that object hasn't changed. + <p>Looks for calls of the same method on the same object when that object hasn't changed. This often is redundant, and the second call can be removed, or combined.</p> <p>It is a fast detector</p> ]]> @@ -614,7 +614,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseToArray"> <Details> <![CDATA[ - <p>looks for code that builds an array of values from a collection, by manually looping + <p>Looks for code that builds an array of values from a collection, by manually looping over the elements of the collection, and adding them to the array. It is simpler and cleaner to use mycollection.toArray(new type[mycollection.size()].</p> <p>It is a fast detector</p> @@ -625,7 +625,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LostExceptionStackTrace"> <Details> <![CDATA[ - <p>looks for methods that catch exceptions, and then throw a different exception, + <p>Looks for methods that catch exceptions, and then throw a different exception, without embedding the original exception in the thrown one. Doing so, hides the real source of the exception, making debugging and fixing these problems difficult.</p> <p>It is a moderately fast detector</p> @@ -636,7 +636,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseCharacterParameterizedMethod"> <Details> <![CDATA[ - <p>looks for methods that pass single character string constants as parameters to + <p>Looks for methods that pass single character string constants as parameters to methods that alternatively have an overridden method that accepts a character instead. It is easier for the method to handle a single character than a String.</p> <p>It is a fast detector.</p> @@ -647,7 +647,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.TailRecursion"> <Details> <![CDATA[ - <p>looks for methods that make a recursive call to itself as the last statement in the + <p>Looks for methods that make a recursive call to itself as the last statement in the method. This tail recursion could be converted into a simple loop which would improve the performance and stack requirements.</p> <p>It is a fast detector.</p> @@ -658,7 +658,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedReturnValues"> <Details> <![CDATA[ - <p>looks for methods that are defined to return Object, and return different types of + <p>Looks for methods that are defined to return Object, and return different types of objects based on different code paths. If this method is not based on a interface or superclass, it is suggested to change the return type to a type that would accomodate all kinds of return types.</p> @@ -670,7 +670,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization"> <Details> <![CDATA[ - <p>looks for classes that don't handle serialization of parent class member fields + <p>Looks for classes that don't handle serialization of parent class member fields when the class in question is serializable but is derived from a non serializable classes.</p> <p>It is a fast detector.</p> @@ -681,7 +681,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues"> <Details> <![CDATA[ - <p>looks for class that implement Comparator or Comparable, and whose compare or compareTo + <p>Looks for class that implement Comparator or Comparable, and whose compare or compareTo methods return constant values only, but that don't represent the three possible choice (a negative number, 0, and a positive number).</p> <p>It is a fast detector.</p> @@ -692,7 +692,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri"> <Details> <![CDATA[ - <p>looks for a potpourri of small problems that do not fit into a common pattern.</p> + <p>Looks for a potpourri of small problems that do not fit into a common pattern.</p> <p>It is a fast detector.</p> ]]> </Details> @@ -712,7 +712,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor"> <Details> <![CDATA[ - <p>looks for classes that implement interfaces by relying on methods being + <p>Looks for classes that implement interfaces by relying on methods being implemented in superclasses, even tho the superclass knows nothing about the interface being implemented by the child.</p> <p>It is a fast detector.</p> @@ -723,7 +723,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating"> <Details> <![CDATA[ - <p>looks for deletion of items from a collection using the remove method + <p>Looks for deletion of items from a collection using the remove method of the collection at the same time that the collection is being iterated on. If this occurs the iterator will become invalid and throw a ConcurrentModificationException. Instead, the remove should be called on the iterator itself.</p> @@ -735,7 +735,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseSplit"> <Details> <![CDATA[ - <p>looks for code that builds an array by using a StringTokenizer to break up + <p>Looks for code that builds an array by using a StringTokenizer to break up a string and place individual elements into an array. It is simpler to use String.split instead.</p> <p>It is a fast detector.</p> @@ -746,7 +746,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse"> <Details> <![CDATA[ - <p>looks for calls to classes and methods that do not exist in the JDK for which this class is + <p>Looks for calls to classes and methods that do not exist in the JDK for which this class is compiled. This can happen if you specify the -source and -target options of the javac compiler, and specify a target that is less than the jdk version of the javac compiler.</p> <p>It is a slow detector.</p> @@ -757,7 +757,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UseAddAll"> <Details> <![CDATA[ - <p>looks for loops that transfers the contents of one collection to another. These collection sources might + <p>Looks for loops that transfers the contents of one collection to another. These collection sources might be local variables or member fields, including sets, maps key/values, lists, or arrays. It is simpler to just use the addAll method of the collection class. In the case where the source is an array, you can use Arrays.asList(array), and use that as the source to addAll.</p> @@ -769,7 +769,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant"> <Details> <![CDATA[ - <p>looks for private or static methods that only return one constant value. Since there is no + <p>Looks for private or static methods that only return one constant value. Since there is no chance for derived classes overriding this behavior, the return of a constant value seems dubious.</p> <p>It is a fast detector</p> @@ -780,7 +780,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessCustomSerialization"> <Details> <![CDATA[ - <p>looks for classes that implement the Serializable interface and implement the + <p>Looks for classes that implement the Serializable interface and implement the standard readObject and writeObject methods by simply deferring to the Stream parameter's defaultReadObject or defaultWriteObject and nothing else. As this is the built in behavior, these methods are not needed.</p> @@ -792,7 +792,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.MisleadingOverloadModel"> <Details> <![CDATA[ - <p>looks for classes that define both static and instance methods with the same name. + <p>Looks for classes that define both static and instance methods with the same name. As each type represents a different use model, it doesn't make sense that this name would be overloaded, and will confuse users of the class.</p> <p>It is a fast detector</p> @@ -803,7 +803,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ExceptionSoftening"> <Details> <![CDATA[ - <p>looks for methods that catch checked exceptions, and throw unchecked + <p>Looks for methods that catch checked exceptions, and throw unchecked exceptions in their place. There are several levels of concern. Least concerning are methods constrained by interface or super class contracts not to throw checked exceptions but appear owned by the same author. Next @@ -818,7 +818,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics"> <Details> <![CDATA[ - <p>looks for methods that return a parameter after modifying that parameter. + <p>Looks for methods that return a parameter after modifying that parameter. Doing this will confuse the user of this method, as it will be assumed that the passed in argument is different than the output, or at least won't be changed. If the purpose of this method is just to modify the parameter, this method should @@ -833,7 +833,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities"> <Details> <![CDATA[ - <p>looks for junit test case methods that use assertions with odd parameters. + <p>Looks for junit test case methods that use assertions with odd parameters. Including in this is: <ul> <li>Passing a constant as the second (actual) parameter</li> @@ -849,7 +849,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm"> <Details> <![CDATA[ - <p>looks for implementations of clone where an assignment is made to a field of the + <p>Looks for implementations of clone where an assignment is made to a field of the source object. It is likely that that store should have occurred on the cloned object, as the clone operation is almost always considered read only.</p> <p>It is a fast detector</p> @@ -860,7 +860,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging"> <Details> <![CDATA[ - <p>looks for exceptions that are thrown with static strings as messages. Using static strings + <p>Looks for exceptions that are thrown with static strings as messages. Using static strings doesn't differentiate one use of this method versus another, and so it may be difficult to determine how this exception occurred without showing context.</p> <p>It is a fast detector</p> @@ -871,7 +871,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport"> <Details> <![CDATA[ - <p>looks for code that fetches a complex object from an HttpSession attribute, modifies the + <p>Looks for code that fetches a complex object from an HttpSession attribute, modifies the object, but does not call setAttribute again on this object. This will not inform the application server that this object has changed, and thus will not correctly replicate these changes across the cluster.</p> <p>It is a fast detector</p> @@ -882,7 +882,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities"> <Details> <![CDATA[ - <p>looks for odd patterns of use of Logger classes from either log4j or slf4j.</p> + <p>Looks for odd patterns of use of Logger classes from either log4j or slf4j.</p> <p>It is a fast detector</p> ]]> </Details> @@ -891,7 +891,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse"> <Details> <![CDATA[ - <p>looks for classes that rely on internal classes in the various apis or libraries. As these + <p>Looks for classes that rely on internal classes in the various apis or libraries. As these classes are not officially released from the api vendor, they are subject to change or removal, and thus, should not be counted on.</p> Packages that shouldn't be used are: @@ -908,7 +908,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousSetOfCollections"> <Details> <![CDATA[ - <p>looks for sets or keySets of maps that contain other collections. As typically collections calculate + <p>Looks for sets or keySets of maps that contain other collections. As typically collections calculate their hashCode, equals and compareTo methods by iterating the collection and evaluating the same function on each item in the collection, this can be costly from a performance point of view.</p> <p>In addition, using a set, or keySet of a map, infers that you will be looking for items based on @@ -925,7 +925,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.BogusExceptionDeclaration"> <Details> <![CDATA[ - <p>looks for constructors, static methods and private methods that declare that they throw + <p>Looks for constructors, static methods and private methods that declare that they throw checked exceptions that the actual code never throws. Since these methods can't be overridden, there is no reason to add these exceptions to the method declaration.</p> <p>It is a moderately fast detector</p> @@ -936,7 +936,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryNewNullCheck"> <Details> <![CDATA[ - <p>looks for allocations of objects, and then immediately checking to see if the + <p>Looks for allocations of objects, and then immediately checking to see if the object is null, or non null. As the new operator is guaranteed to eiher succeed, or throw an exception, this null check is useless, and denotes a misunderstanding as to how the jvm works. You can remove this guard.</p> @@ -948,7 +948,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.DeprecatedTypesafeEnumPattern"> <Details> <![CDATA[ - <p>looks for classes that appear to implement the old style type safe enum pattern + <p>Looks for classes that appear to implement the old style type safe enum pattern that was used before java added Enum support to the language. Since this class is compiled with java 1.5 or later, it would be simpler to just use java enums</p> <p>It is a fast detector</p> @@ -959,7 +959,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments"> <Details> experimental="true" <![CDATA[ - <p>looks for method calls that pass the same value for two separate parameters, where + <p>Looks for method calls that pass the same value for two separate parameters, where those arguments are not constants. Often this is a cut/paste mistake, but if not, it is confusing why you would pass the same value for two arguments.</p> <p>It is a fast detector</p> @@ -970,7 +970,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern"> <Details> <![CDATA[ - <p>looks for methods that are declared to return a Boolean, but return a null + <p>Looks for methods that are declared to return a Boolean, but return a null value. As this now allows the method to return 3 values, the use of Boolean is dubious. It would be better to just define a new enumeration with three values, and return that.</p> @@ -982,7 +982,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray"> <Details> <![CDATA[ - <p>looks for methods that return arrays that are allocated but not initialized + <p>Looks for methods that return arrays that are allocated but not initialized in this method. While it's possible that the calling method will do the work of initializing the array, it is not a usual pattern, and it suspected that this array was just forgotten to be initialized.</p> @@ -994,7 +994,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse"> <Details> <![CDATA[ - <p>looks for methods that perform algorithmic operations on Strings that are returned + <p>Looks for methods that perform algorithmic operations on Strings that are returned from a toString() method. As toString should only be used for debug/trace purposes, it shouldn't be used for algorithm use.</p> <p>It is a fast detector</p> @@ -1005,7 +1005,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing"> <Details> <![CDATA[ - <p>looks for methods that use the same name with different casing to access objects in HttpRequest parameters + <p>Looks for methods that use the same name with different casing to access objects in HttpRequest parameters and attributes. As these parameter names are case sensitive this will lead to confusion.</p> <p>It is a fast detector</p> ]]> @@ -1015,7 +1015,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.OverzealousCasting"> <Details> <![CDATA[ - <p>looks for manual casts of objects that are more specific then needed as the value is assigned + <p>Looks for manual casts of objects that are more specific then needed as the value is assigned to a class or interface higher up in the inheritance chain. You only need to cast to that class or interface.</p> <p>It is a fast detector</p> @@ -1026,7 +1026,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PoorlyDefinedParameter"> <Details> <![CDATA[ - <p>looks for non derivable methods that declare parameters and then cast those + <p>Looks for non derivable methods that declare parameters and then cast those parameters to more specific types in the method. This is misleading and dangerous as you are not documenting through parameter types what is necessary for these parameters to function correctly.</p> @@ -1038,7 +1038,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonSymmetricEquals"> <Details> <![CDATA[ - <p>looks for classes that break the fundamental rule of equivalence, which is + <p>Looks for classes that break the fundamental rule of equivalence, which is symmetry. If a equals b, then b equals a. While it is usually wrong to allow equals to compare different types, at the very least you should make sure that each class knows about each other and is able to compare themselves with each other.</p> @@ -1069,7 +1069,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField"> <Details> <![CDATA[ - <p>looks for fields in serializable classes that are defined as both final and + <p>Looks for fields in serializable classes that are defined as both final and transient. As a transient field is not initialized when streamed, and is not initialized in a constructor, it will remain null because it is defined final.</p> <p>It is a fast detector</p> @@ -1080,7 +1080,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard"> <Details> <![CDATA[ - <p>looks for code that checks to see if a field or local variable is not null, + <p>Looks for code that checks to see if a field or local variable is not null, before entering a code block either an if, or while statement, and then doesn't reference that field or local in the block of code that is guarded by the null check. It is likely that null check is being done on the wrong variable, either This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-10 01:25:56
|
Revision: 1608 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1608&view=rev Author: dbrosius Date: 2010-09-10 01:25:50 +0000 (Fri, 10 Sep 2010) Log Message: ----------- add support for commons logging in LO Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-09-06 02:47:08 UTC (rev 1607) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-10 01:25:50 UTC (rev 1608) @@ -195,7 +195,7 @@ <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> --> <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> - <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" hidden="true" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> --> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> @@ -375,4 +375,4 @@ <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" experimental="true" /> <BugPattern abbrev="SGSU" type="SGSU_SUSPICIOUS_GETTER_SETTER_USE" category="CORRECTNESS" experimental="true" /> -</FindbugsPlugin> \ No newline at end of file +</FindbugsPlugin> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2010-09-06 02:47:08 UTC (rev 1607) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LoggerOddities.java 2010-09-10 01:25:50 UTC (rev 1608) @@ -91,7 +91,8 @@ { String parmSig = t.getSignature(); if ("Lorg/slf4j/Logger;".equals(parmSig) - || "Lorg/apache/log4j/Logger;".equals(parmSig)) { + || "Lorg/apache/log4j/Logger;".equals(parmSig) + || "Lorg/apache/commons/logging/Log;".equals(parmSig)) { bugReporter.reportBug(new BugInstance(this, "LO_SUSPECT_LOG_PARAMETER", NORMAL_PRIORITY) .addClass(this) .addMethod(this) @@ -136,8 +137,9 @@ if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); loggingClassName = (String)item.getConstant(); - if (loggingClassName != null) - loggingClassName = loggingClassName.replace('.', '/'); + if (loggingClassName != null) { + loggingClassName = loggingClassName.replace('.', '/'); + } } } } else if ("org/apache/log4j/Logger".equals(callingClsName) @@ -153,17 +155,37 @@ if (stack.getStackDepth() > 0) { OpcodeStack.Item item = stack.getStackItem(0); loggingClassName = (String)item.getConstant(); - if (loggingClassName != null) - loggingClassName = loggingClassName.replace('.', '/'); + if (loggingClassName != null) { + loggingClassName = loggingClassName.replace('.', '/'); + } } } else if ("(Ljava/lang/String;Lorg/apache/log4j/spi/LoggerFactory;)Lorg/apache/log4j/Logger;".equals(signature)) { if (stack.getStackDepth() > 1) { OpcodeStack.Item item = stack.getStackItem(1); loggingClassName = (String)item.getConstant(); - if (loggingClassName != null) - loggingClassName = loggingClassName.replace('.', '/'); + if (loggingClassName != null) { + loggingClassName = loggingClassName.replace('.', '/'); + } } } + } else if ("org/apache/commons/logging/LogFactory".equals(callingClsName) + && "getLog".equals(mthName)) { + String signature = getSigConstantOperand(); + + if ("(Ljava/lang/Class;)Lorg/apache/commons/logging/Log;".equals(signature)) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + loggingClassName = (String)item.getUserValue(); + } + } else if ("(Ljava/lang/String;)Lorg/apache/commons/logging/Log;".equals(signature)) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + loggingClassName = (String)item.getConstant(); + if (loggingClassName != null) { + loggingClassName = loggingClassName.replace('.', '/'); + } + } + } } if (loggingClassName != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-06 02:47:14
|
Revision: 1607 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1607&view=rev Author: dbrosius Date: 2010-09-06 02:47:08 +0000 (Mon, 06 Sep 2010) Log Message: ----------- more fps Modified Paths: -------------- trunk/fb-contrib/samples/SNG_Sample.java Modified: trunk/fb-contrib/samples/SNG_Sample.java =================================================================== --- trunk/fb-contrib/samples/SNG_Sample.java 2010-09-05 00:37:58 UTC (rev 1606) +++ trunk/fb-contrib/samples/SNG_Sample.java 2010-09-06 02:47:08 UTC (rev 1607) @@ -5,69 +5,98 @@ { private static byte[] EMPTY_BYTE_ARRAY = new byte[0]; private Object f1 = null; - private Object f2 = null; - private File file = null; + private final Object f2 = null; + private final File file = null; private byte[] buffer = null; public String badSNGFields() { - if (f1 != null) + if (f1 != null) + { return f2.toString(); + } return null; } public String badSNGLocals(Object l1, Object l2) { - if (l1 != null) + if (l1 != null) + { return l2.toString(); + } return null; } - public boolean fpReturn(Object o) { + public boolean fpReturn(Object o) + { return o != null; } - public boolean fpAssign(Object o) { + public boolean fpAssign(Object o) + { boolean b = o != null; return b; } - public boolean fpField() { - if (f1 != null) + public boolean fpField() + { + if (f1 != null) + { return true; + } return false; } - public void fpAssert() { - assert f1 != null && f1.equals(f2); + public void fpAssert() + { + assert (f1 != null) && f1.equals(f2); } public Object fpSetNull(Object o) { if (o != null) + { o = null; + } return o; } - public void fpSetMemberNull() { - if (f1 != null) + public void fpSetMemberNull() + { + if (f1 != null) + { f1 = null; + } } - public void fpDual(Object o1, Object o2) { - if (o1 == null || o2 == null) { + public void fpDual(Object o1, Object o2) + { + if ((o1 == null) || (o2 == null)) + { throw new IllegalArgumentException("o1/o2 can not be null"); } } - public void discard() { - if (file != null) { + public void discard() + { + if (file != null) + { file.delete(); - } else if (buffer != null) { + } + else if (buffer != null) + { buffer = EMPTY_BYTE_ARRAY; } } + + public void fpCompound() + { + if ((file == null) || (buffer[0] == 0)) + { + f1 = f2; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-05 00:38:04
|
Revision: 1606 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1606&view=rev Author: dbrosius Date: 2010-09-05 00:37:58 +0000 (Sun, 05 Sep 2010) Log Message: ----------- handle field based beans correctly Modified Paths: -------------- trunk/fb-contrib/samples/SGSU_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java Modified: trunk/fb-contrib/samples/SGSU_Sample.java =================================================================== --- trunk/fb-contrib/samples/SGSU_Sample.java 2010-09-04 20:41:14 UTC (rev 1605) +++ trunk/fb-contrib/samples/SGSU_Sample.java 2010-09-05 00:37:58 UTC (rev 1606) @@ -2,12 +2,23 @@ public class SGSU_Sample { private SGSU_Sample foo; + private SGSU_Sample foo2; - public void testSGSU(SGSU_Sample s1, SGSU_Sample s2) + public void testSGSULocals(SGSU_Sample s1, SGSU_Sample s2) { s1.setSGSU(s1.getSGSU()); } + public void testSGSUFields() + { + foo.setSGSU(foo.getSGSU()); + } + + public void fpSGSUFields() + { + foo.setSGSU(foo2.getSGSU()); + } + public void setSGSU(SGSU_Sample f) { foo = f; Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java 2010-09-04 20:41:14 UTC (rev 1605) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java 2010-09-05 00:37:58 UTC (rev 1606) @@ -33,9 +33,11 @@ private static enum State {SEEN_NOTHING, SEEN_ALOAD, SEEN_GETFIELD, SEEN_DUAL_LOADS, SEEN_INVOKEVIRTUAL}; private final BugReporter bugReporter; private State state; - private String beanReference; + private String beanReference1; + private String beanReference2; private String propName; private String propType; + private boolean sawField; /** * constructs a SGSU detector given the reporter to report bugs on @@ -54,9 +56,11 @@ @Override public void visitCode(Code obj) { state = State.SEEN_NOTHING; - beanReference = null; + beanReference1 = null; + beanReference2 = null; propName = null; propType = null; + sawField = false; super.visitCode(obj); } @@ -77,16 +81,10 @@ case ALOAD_1: case ALOAD_2: case ALOAD_3: - beanReference = String.valueOf(getRegisterOperand()); + beanReference1 = String.valueOf(getRegisterOperand()); state = State.SEEN_ALOAD; reset = false; break; - - case GETFIELD: - beanReference = getNameConstantOperand(); - state = State.SEEN_GETFIELD; - reset = false; - break; } break; @@ -97,19 +95,42 @@ case ALOAD_1: case ALOAD_2: case ALOAD_3: - if (beanReference.equals(String.valueOf(getRegisterOperand()))) { + if (!sawField && beanReference1.equals(String.valueOf(getRegisterOperand()))) { state = State.SEEN_DUAL_LOADS; reset = false; } break; + + case GETFIELD: { + if (sawField) { + beanReference2 += ":" + getNameConstantOperand(); + if (beanReference1.equals(beanReference2)) { + state = State.SEEN_DUAL_LOADS; + reset = false; + } + } else { + state = State.SEEN_GETFIELD; + beanReference1 += ":" + getNameConstantOperand(); + sawField = true; + reset = false; + } + } } break; - case SEEN_GETFIELD: - if (beanReference.equals(getNameConstantOperand())) { - state = State.SEEN_DUAL_LOADS; - reset = false; + case SEEN_GETFIELD: { + switch (seen) { + case ALOAD: + case ALOAD_0: + case ALOAD_1: + case ALOAD_2: + case ALOAD_3: + beanReference2 = String.valueOf(getRegisterOperand()); + state = State.SEEN_ALOAD; + reset = false; + break; } + } break; case SEEN_DUAL_LOADS: @@ -148,9 +169,11 @@ } if (reset) { - beanReference = null; + beanReference1 = null; + beanReference2 = null; propType = null; propName = null; + sawField = false; state = State.SEEN_NOTHING; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-04 20:41:21
|
Revision: 1605 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1605&view=rev Author: dbrosius Date: 2010-09-04 20:41:14 +0000 (Sat, 04 Sep 2010) Log Message: ----------- document SGSU Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-09-04 20:38:51 UTC (rev 1604) +++ trunk/fb-contrib/htdocs/index.shtml 2010-09-04 20:41:14 UTC (rev 1605) @@ -98,6 +98,10 @@ the code more difficult to maintain as it has a tendency to increase cohesion between classes. </li> + <li><b>[SGSU] Suspicious Getter Setter Use</b><br/> + Looks for the setting of a java bean property with a value retrieved from the same + bean's getter method for that property. This is usually a copy/paste typo. + </li> </ul> </div> <hr/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-04 20:38:57
|
Revision: 1604 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1604&view=rev Author: dbrosius Date: 2010-09-04 20:38:51 +0000 (Sat, 04 Sep 2010) Log Message: ----------- add spaces to SUA's Bug Code Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-09-04 20:38:03 UTC (rev 1603) +++ trunk/fb-contrib/etc/messages.xml 2010-09-04 20:38:51 UTC (rev 1604) @@ -3320,7 +3320,7 @@ <BugCode abbrev="DTEP">Deprecated Typesafe Enum Pattern</BugCode> <BugCode abbrev="SMA">Stuttered Method Arguments</BugCode> <BugCode abbrev="TBP">Tristate Boolean Pattern</BugCode> - <BugCode abbrev="SUA">SuspiciousUninitializedArray</BugCode> + <BugCode abbrev="SUA">Suspicious Uninitialized Array</BugCode> <BugCode abbrev="ITU">Inappropriate ToString Use</BugCode> <BugCode abbrev="IKNC">Inconsistent Key Name Casing</BugCode> <BugCode abbrev="OC">Overzealous Casting</BugCode> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-09-04 20:38:10
|
Revision: 1603 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1603&view=rev Author: dbrosius Date: 2010-09-04 20:38:03 +0000 (Sat, 04 Sep 2010) Log Message: ----------- New detector SGSU Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml Added Paths: ----------- trunk/fb-contrib/samples/SGSU_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-08-31 01:33:46 UTC (rev 1602) +++ trunk/fb-contrib/etc/findbugs.xml 2010-09-04 20:38:03 UTC (rev 1603) @@ -213,6 +213,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor" speed="fast" reports="SEC_SIDE_EFFECT_CONSTRUCTOR" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousGetterSetterUse" speed="fast" reports="SGSU_SUSPICIOUS_GETTER_SETTER_USE" /> <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -373,4 +374,5 @@ <BugPattern abbrev="UVA" type="UVA_USE_VAR_ARGS" category="STYLE" /> <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" experimental="true" /> <BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" experimental="true" /> + <BugPattern abbrev="SGSU" type="SGSU_SUSPICIOUS_GETTER_SETTER_USE" category="CORRECTNESS" experimental="true" /> </FindbugsPlugin> \ No newline at end of file Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-08-31 01:33:46 UTC (rev 1602) +++ trunk/fb-contrib/etc/messages.xml 2010-09-04 20:38:03 UTC (rev 1603) @@ -1178,6 +1178,20 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousGetterSetterUse"> + <Details> + <![CDATA[ + <p>This detector looks for java bean getter-setter use where the value of a property is set + with the value retrieved from the same bean's correllary getter, like this:</p> + <pre> + person.setAge(person.getAge()); + </pre> + <p>Typically this is a copy paste typo.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> @@ -3212,6 +3226,17 @@ ]]> </Details> </BugPattern> + + <BugPattern type="SGSU_SUSPICIOUS_GETTER_SETTER_USE"> + <ShortDescription>Method uses same bean's getter value for setter</ShortDescription> + <LongDescription>Method {1} uses same bean's getter value for setter</LongDescription> + <Details> + <![CDATA[ + <p>This method retrieves the property of a java bean, only to use it in the setter + for the same property of the same bean. This is usually a copy/paste typo. + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -3312,4 +3337,5 @@ <BugCode abbrev="UVA">Use Var Args</BugCode> <BugCode abbrev="PUS">Possible Unsuspected Serialization</BugCode> <BugCode abbrev="SEC">Side Effect Constructor</BugCode> + <BugCode abbrev="SGSU">Suspicious Getter Setter Use</BugCode> </MessageCollection> Added: trunk/fb-contrib/samples/SGSU_Sample.java =================================================================== --- trunk/fb-contrib/samples/SGSU_Sample.java (rev 0) +++ trunk/fb-contrib/samples/SGSU_Sample.java 2010-09-04 20:38:03 UTC (rev 1603) @@ -0,0 +1,20 @@ + +public class SGSU_Sample +{ + private SGSU_Sample foo; + + public void testSGSU(SGSU_Sample s1, SGSU_Sample s2) + { + s1.setSGSU(s1.getSGSU()); + } + + public void setSGSU(SGSU_Sample f) + { + foo = f; + } + + public SGSU_Sample getSGSU() + { + return foo; + } +} Property changes on: trunk/fb-contrib/samples/SGSU_Sample.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.java 2010-09-04 20:38:03 UTC (rev 1603) @@ -0,0 +1,157 @@ +/* + * fb-contrib - Auxiliary detectors for Java programs + * Copyright (C) 2005-2010 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 org.apache.bcel.classfile.Code; + +import edu.umd.cs.findbugs.BugInstance; +import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.BytecodeScanningDetector; + +/** + * looks for methods that set a setter with the value obtained from the same bean's + * complimentary getter. This is usually a typo. + */ +public class SuspiciousGetterSetterUse extends BytecodeScanningDetector { + + private static enum State {SEEN_NOTHING, SEEN_ALOAD, SEEN_GETFIELD, SEEN_DUAL_LOADS, SEEN_INVOKEVIRTUAL}; + private final BugReporter bugReporter; + private State state; + private String beanReference; + private String propName; + private String propType; + + /** + * constructs a SGSU detector given the reporter to report bugs on + * @param bugReporter the sync of bug reports + */ + public SuspiciousGetterSetterUse(BugReporter bugReporter) { + this.bugReporter = bugReporter; + } + + /** + * overrides the visitor to reset the state to SEEN_NOTHING, and clear the beanReference, propName + * and propType + * + * @param code the context object of the currently parsed code block + */ + @Override + public void visitCode(Code obj) { + state = State.SEEN_NOTHING; + beanReference = null; + propName = null; + propType = null; + super.visitCode(obj); + } + + /** + * overrides the visitor to look for a setXXX with the value returned from a getXXX + * using the same base object. + * + * @param seen the currently parsed opcode + */ + @Override + public void sawOpcode(int seen) { + boolean reset = true; + switch (state) { + case SEEN_NOTHING: + switch (seen) { + case ALOAD: + case ALOAD_0: + case ALOAD_1: + case ALOAD_2: + case ALOAD_3: + beanReference = String.valueOf(getRegisterOperand()); + state = State.SEEN_ALOAD; + reset = false; + break; + + case GETFIELD: + beanReference = getNameConstantOperand(); + state = State.SEEN_GETFIELD; + reset = false; + break; + } + break; + + case SEEN_ALOAD: + switch (seen) { + case ALOAD: + case ALOAD_0: + case ALOAD_1: + case ALOAD_2: + case ALOAD_3: + if (beanReference.equals(String.valueOf(getRegisterOperand()))) { + state = State.SEEN_DUAL_LOADS; + reset = false; + } + break; + } + break; + + case SEEN_GETFIELD: + if (beanReference.equals(getNameConstantOperand())) { + state = State.SEEN_DUAL_LOADS; + reset = false; + } + break; + + case SEEN_DUAL_LOADS: + if (seen == INVOKEVIRTUAL) { + String sig = getSigConstantOperand(); + if (sig.startsWith("()")) { + propType = sig.substring("()".length()); + if (!propType.equals("V")) { + propName = getNameConstantOperand(); + if (propName.startsWith("get")) { + propName = propName.substring("get".length()); + state = State.SEEN_INVOKEVIRTUAL; + reset = false; + } + } + } + } + break; + + case SEEN_INVOKEVIRTUAL: + if (seen == INVOKEVIRTUAL) { + String sig = getSigConstantOperand(); + if (sig.equals("(" + propType + ")V")) { + String name = getNameConstantOperand(); + if (name.startsWith("set")) { + if (propName.equals(name.substring("set".length()))) { + bugReporter.reportBug(new BugInstance(this, "SGSU_SUSPICIOUS_GETTER_SETTER_USE", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + } + } + } + break; + } + + if (reset) { + beanReference = null; + propType = null; + propName = null; + state = State.SEEN_NOTHING; + } + } +} Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousGetterSetterUse.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...> - 2010-08-31 01:33:52
|
Revision: 1602 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1602&view=rev Author: dbrosius Date: 2010-08-31 01:33:46 +0000 (Tue, 31 Aug 2010) Log Message: ----------- a better way, if the throw directly follows a MONITOREXIT, it's probably synthetic, so mark it LOW Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:30:07 UTC (rev 1601) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:33:46 UTC (rev 1602) @@ -246,7 +246,8 @@ && itm.getUserValue() == null) { if (!isPre14Class(itm.getJavaClass())) { - bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", NORMAL_PRIORITY) + int priority = getPrevOpcode(1) == MONITOREXIT ? LOW_PRIORITY : NORMAL_PRIORITY; + bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", priority) .addClass(this) .addMethod(this) .addSourceLine(this)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-31 01:30:13
|
Revision: 1601 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1601&view=rev Author: dbrosius Date: 2010-08-31 01:30:07 +0000 (Tue, 31 Aug 2010) Log Message: ----------- rollback -- wasn't working as i first thought Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:26:54 UTC (rev 1600) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:30:07 UTC (rev 1601) @@ -246,20 +246,7 @@ && itm.getUserValue() == null) { if (!isPre14Class(itm.getJavaClass())) { - int priority = NORMAL_PRIORITY; - - LocalVariableTable lvt = getCode().getLocalVariableTable(); - if (lvt != null) { - LocalVariable lv = lvt.getLocalVariable(itm.getRegisterNumber(), getPC()); - if (lv == null) { - /** It's probably synthetic, for instance throwing an exception - * out of a synchronized block - */ - priority = LOW_PRIORITY; - } - } - - bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", priority) + bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", NORMAL_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-31 01:27:01
|
Revision: 1600 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1600&view=rev Author: dbrosius Date: 2010-08-31 01:26:54 +0000 (Tue, 31 Aug 2010) Log Message: ----------- weaken the LEST report, when the situation looks like it's synthetic, for instance throwing exceptions out of synchronized blocks Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:10:22 UTC (rev 1599) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2010-08-31 01:26:54 UTC (rev 1600) @@ -85,7 +85,7 @@ @Override public void visitClassContext(ClassContext classContext) { try { - if ((throwableClass != null) && (!isPre14Class(classContext.getJavaClass()))) { + if (throwableClass != null && !isPre14Class(classContext.getJavaClass())) { stack = new OpcodeStack(); catchInfos = new HashSet<CatchInfo>(); exReg = new HashMap<Integer, Boolean>(); @@ -113,13 +113,13 @@ } CodeException[] ce = code.getExceptionTable(); - if ((ce == null) || (ce.length == 0)) + if (ce == null || ce.length == 0) { return false; } BitSet bytecodeSet = getClassContext().getBytecodeSet(method); - return (bytecodeSet != null) && (bytecodeSet.get(Constants.ATHROW)); + return bytecodeSet != null && bytecodeSet.get(Constants.ATHROW); } /** @@ -148,7 +148,7 @@ public CodeException[] collectExceptions(CodeException[] exs) { List<CodeException> filteredEx = new ArrayList<CodeException>(); for (CodeException ce : exs) { - if ((ce.getCatchType() != 0) && (ce.getStartPC() < ce.getEndPC()) && (ce.getEndPC() <= ce.getHandlerPC())) { + if (ce.getCatchType() != 0 && ce.getStartPC() < ce.getEndPC() && ce.getEndPC() <= ce.getHandlerPC()) { filteredEx.add(ce); } } @@ -168,11 +168,11 @@ int pc = getPC(); for (CodeException ex : exceptions) { if (pc == ex.getEndPC()) { - if ((seen >= IRETURN) && (seen <= RETURN)) + if (seen >= IRETURN && seen <= RETURN) { addCatchBlock(ex.getHandlerPC(), Integer.MAX_VALUE); } - else if ((seen == GOTO) || (seen == GOTO_W)) + else if (seen == GOTO || seen == GOTO_W) { addCatchBlock(ex.getHandlerPC(), this.getBranchTarget()); } @@ -198,15 +198,15 @@ } else if (pc > catchInfo.getFinish()) { it.remove(); break; - } else if ((pc > catchInfo.getStart()) && (pc <= catchInfo.getFinish())) { + } else if (pc > catchInfo.getStart() && pc <= catchInfo.getFinish()) { if (seen == INVOKESPECIAL) { if ("<init>".equals(getNameConstantOperand())) { String className = getClassConstantOperand(); JavaClass exClass = Repository.lookupClass(className); if (exClass.instanceOf(throwableClass)) { String sig = getSigConstantOperand(); - if ((sig.indexOf("Exception") >= 0) - || (sig.indexOf("Throwable") >= 0)) { + if (sig.indexOf("Exception") >= 0 + || sig.indexOf("Throwable") >= 0) { markAsValid = true; break; } @@ -234,7 +234,7 @@ } else if (isPossibleExBuilder(catchInfo.getRegister())) { markAsValid = true; } - } else if ((seen == INVOKEINTERFACE) || (seen == INVOKESTATIC)) { + } else if (seen == INVOKEINTERFACE || seen == INVOKESTATIC) { if (isPossibleExBuilder(catchInfo.getRegister())) { markAsValid = true; @@ -242,11 +242,24 @@ } else if (seen == ATHROW) { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); - if ((itm.getRegisterNumber() != catchInfo.getRegister()) - && (itm.getUserValue() == null)) { + if (itm.getRegisterNumber() != catchInfo.getRegister() + && itm.getUserValue() == null) { if (!isPre14Class(itm.getJavaClass())) { - bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", NORMAL_PRIORITY) + int priority = NORMAL_PRIORITY; + + LocalVariableTable lvt = getCode().getLocalVariableTable(); + if (lvt != null) { + LocalVariable lv = lvt.getLocalVariable(itm.getRegisterNumber(), getPC()); + if (lv == null) { + /** It's probably synthetic, for instance throwing an exception + * out of a synchronized block + */ + priority = LOW_PRIORITY; + } + } + + bugReporter.reportBug(new BugInstance(this, "LEST_LOST_EXCEPTION_STACK_TRACE", priority) .addClass(this) .addMethod(this) .addSourceLine(this)); @@ -255,7 +268,7 @@ break; } } - } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { + } else if (seen == ASTORE || seen >= ASTORE_0 && seen <= ASTORE_3) { if (lastWasExitPoint) { //crazy jdk6 finally block injection -- shut off detection catchInfos.clear(); @@ -266,17 +279,17 @@ OpcodeStack.Item itm = stack.getStackItem(0); int reg = RegisterUtils.getAStoreReg(this, seen); exReg.put(Integer.valueOf(reg), (Boolean)itm.getUserValue()); - if ((reg == catchInfo.getRegister() && catchInfo.getFinish() == Integer.MAX_VALUE)) { + if (reg == catchInfo.getRegister() && catchInfo.getFinish() == Integer.MAX_VALUE) { it.remove(); } } - } else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { + } else if (seen == ALOAD || seen >= ALOAD_0 && seen <= ALOAD_3) { Boolean valid = exReg.get(Integer.valueOf(RegisterUtils.getALoadReg(this, seen))); if (valid != null) { markAsValid = valid.booleanValue(); } - } else if ((seen >= IRETURN) && (seen <= RETURN)) { + } else if (seen >= IRETURN && seen <= RETURN) { removeIndeterminateHandlers(pc); break; } @@ -287,7 +300,7 @@ } } - lastWasExitPoint = ((seen >= IRETURN) && (seen <= RETURN)) || (seen == GOTO) || (seen == GOTO_W) || (seen == ATHROW); + lastWasExitPoint = seen >= IRETURN && seen <= RETURN || seen == GOTO || seen == GOTO_W || seen == ATHROW; } finally { stack.sawOpcode(this, seen); @@ -336,7 +349,7 @@ */ private boolean isPre14Class(JavaClass cls) { - return (cls != null) && cls.getMajor() < Constants.MAJOR_1_4; + return cls != null && cls.getMajor() < Constants.MAJOR_1_4; } private void removePreviousHandlers(int pc) @@ -357,7 +370,7 @@ Iterator<CatchInfo> it = catchInfos.iterator(); while (it.hasNext()) { CatchInfo ci = it.next(); - if ((ci.getStart() < pc) && (ci.getFinish() == Integer.MAX_VALUE)) + if (ci.getStart() < pc && ci.getFinish() == Integer.MAX_VALUE) { it.remove(); } @@ -376,7 +389,7 @@ * @return whether the catch block is empty */ private boolean updateExceptionRegister(CatchInfo ci, int seen, int pc) { - if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) { + if (seen == ASTORE || seen >= ASTORE_0 && seen <= ASTORE_3) { int reg = RegisterUtils.getAStoreReg(this, seen); ci.setReg(reg); exReg.put(Integer.valueOf(reg), Boolean.TRUE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-31 01:10:29
|
Revision: 1599 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1599&view=rev Author: dbrosius Date: 2010-08-31 01:10:22 +0000 (Tue, 31 Aug 2010) Log Message: ----------- fix various spilleng and engrish problems in bug detectors and web page, thanks to Jean-No?\195?\171l Rouvignac Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-08-30 12:55:14 UTC (rev 1598) +++ trunk/fb-contrib/etc/messages.xml 2010-08-31 01:10:22 UTC (rev 1599) @@ -1159,7 +1159,7 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleUnsuspectedSerialization"> <Details> <![CDATA[ - <p>This detector looks for code that serailizes objects that are non-static inner + <p>This detector looks for code that serializes objects that are non-static inner classes of other classes. Since there is a reference to the containing class, this class will be serialized as well. It is often the case that this is not what is wanted, and will cause much more data to be serialized than is necessary.</p> @@ -3206,9 +3206,9 @@ <Details> <![CDATA[ <p>This method creates an object but does not assign this object to any variable or field. - This implies that the class operations through side effects in the constructor, which is a - bad pattern to use, as it adds unnecessary coupling. Consider pulling the side effect out of the constructor, into a separate method, - or into the calling method. + This implies that the class operates through side effects in the constructor, which is a + bad pattern to use, as it adds unnecessary coupling. Consider pulling the side effect out of + the constructor, into a separate method, or into the calling method. ]]> </Details> </BugPattern> Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-08-30 12:55:14 UTC (rev 1598) +++ trunk/fb-contrib/htdocs/index.shtml 2010-08-31 01:10:22 UTC (rev 1599) @@ -90,8 +90,14 @@ or a change in implementation.</li> <li><b>[PUS] Possible Unsuspected Serialization</b><br/> Looks for serialization of non-static inner classes. As this serializes - the enclosing class, it may unintentially bring in more to the serialization + the enclosing class, it may unintentionally bring in more to the serialization than is wanted.</li> + <li><b>[SEC] Side Effect Constructor</b><br/> + Looks for constructors that operate through side effects, specifically + constructors that aren't assigned to any variable or field. This makes + the code more difficult to maintain as it has a tendency to increase cohesion + between classes. + </li> </ul> </div> <hr/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-30 12:55:20
|
Revision: 1598 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1598&view=rev Author: dbrosius Date: 2010-08-30 12:55:14 +0000 (Mon, 30 Aug 2010) Log Message: ----------- engrish Modified Paths: -------------- trunk/fb-contrib/etc/messages.xml Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-08-30 02:43:22 UTC (rev 1597) +++ trunk/fb-contrib/etc/messages.xml 2010-08-30 12:55:14 UTC (rev 1598) @@ -3207,8 +3207,8 @@ <![CDATA[ <p>This method creates an object but does not assign this object to any variable or field. This implies that the class operations through side effects in the constructor, which is a - pattern to use. Consider pull the side effect out of the constructor, into a separate method, - of into the calling method. + bad pattern to use, as it adds unnecessary coupling. Consider pulling the side effect out of the constructor, into a separate method, + or into the calling method. ]]> </Details> </BugPattern> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-30 02:43:28
|
Revision: 1597 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1597&view=rev Author: dbrosius Date: 2010-08-30 02:43:22 +0000 (Mon, 30 Aug 2010) Log Message: ----------- later jdk's can be sloppy about tidying up the stack, so look for returns with unassigned allocations still on the stack Modified Paths: -------------- trunk/fb-contrib/samples/SEC_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java Modified: trunk/fb-contrib/samples/SEC_Sample.java =================================================================== --- trunk/fb-contrib/samples/SEC_Sample.java 2010-08-29 06:22:58 UTC (rev 1596) +++ trunk/fb-contrib/samples/SEC_Sample.java 2010-08-30 02:43:22 UTC (rev 1597) @@ -14,4 +14,11 @@ List<SEC_Sample> l = new ArrayList<SEC_Sample>(); new SEC_Sample(l); } + + public void test() + { + List<SEC_Sample> l = new ArrayList<SEC_Sample>(); + new SEC_Sample(l); + main(new String[0]); + } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java 2010-08-29 06:22:58 UTC (rev 1596) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java 2010-08-30 02:43:22 UTC (rev 1597) @@ -19,10 +19,13 @@ package com.mebigfatguy.fbcontrib.detect; import org.apache.bcel.classfile.Code; +import org.apache.bcel.generic.Type; 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.ba.ClassContext; /** * looks for constructors that operate through side effects, specifically @@ -32,6 +35,7 @@ private enum State {SAW_NOTHING, SAW_CTOR}; private final BugReporter bugReporter; + private OpcodeStack stack; private State state; /** @@ -44,42 +48,92 @@ } /** - * overrides the visitor to reset the state + * overrides the visitor to set up and tear down the opcode stack * + * @param classContext the context object of the currently parsed class + */ + @Override + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + stack = null; + } + } + /** + * overrides the visitor to reset the state and reset the opcode stack + * * @param obj the context object of the currently parsed code */ @Override public void visitCode(Code obj) { state = State.SAW_NOTHING; + stack.resetForMethodEntry(this); super.visitCode(obj); } + /** * overrides the visitor to look for constructors who's value is - * popped off the stack, and not assigned. + * popped off the stack, and not assigned before the pop of the value, or if a + * return is issued with that object still on the stack. * * @param seen the opcode of the currently parse opcode */ @Override public void sawOpcode(int seen) { - switch (state) { - case SAW_NOTHING: - if (seen == INVOKESPECIAL) { - String name = getNameConstantOperand(); - if ("<init>".equals(name)) { - state = State.SAW_CTOR; + int pc = 0; + try { + switch (state) { + case SAW_NOTHING: + if (seen == INVOKESPECIAL) { + String name = getNameConstantOperand(); + if ("<init>".equals(name)) { + String sig = getSigConstantOperand(); + int numArgs = Type.getArgumentTypes(sig).length; + if (stack.getStackDepth() > numArgs) { + OpcodeStack.Item caller = stack.getStackItem(numArgs); + if (caller.getRegisterNumber() != 0) { + state = State.SAW_CTOR; + pc = getPC(); + } + } + } + } else if (seen == RETURN) { + int depth = stack.getStackDepth(); + for (int i = 0; i < depth; i++) { + OpcodeStack.Item item = stack.getStackItem(i); + Integer secPC = (Integer)item.getUserValue(); + if (secPC != null) { + bugReporter.reportBug(new BugInstance(this, "SEC_SIDE_EFFECT_CONSTRUCTOR", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this, secPC.intValue())); + break; + } + + } } + break; + + case SAW_CTOR: + if (seen == POP || seen == RETURN) { + bugReporter.reportBug(new BugInstance(this, "SEC_SIDE_EFFECT_CONSTRUCTOR", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + state = State.SAW_NOTHING; + break; + } + } finally { + stack.sawOpcode(this, seen); + if (pc != 0) { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item item = stack.getStackItem(0); + item.setUserValue(Integer.valueOf(pc)); } - break; - - case SAW_CTOR: - if (seen == POP) { - bugReporter.reportBug(new BugInstance(this, "SEC_SIDE_EFFECT_CONSTRUCTOR", NORMAL_PRIORITY) - .addClass(this) - .addMethod(this) - .addSourceLine(this)); - } - state = State.SAW_NOTHING; - break; + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-29 06:23:04
|
Revision: 1596 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1596&view=rev Author: dbrosius Date: 2010-08-29 06:22:58 +0000 (Sun, 29 Aug 2010) Log Message: ----------- add javadoc to svnignore Property Changed: ---------------- trunk/fb-contrib/ Property changes on: trunk/fb-contrib ___________________________________________________________________ Modified: svn:ignore - .cvsignore *.fb *.jar *.txt *.db + javadoc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-29 06:21:51
|
Revision: 1595 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1595&view=rev Author: dbrosius Date: 2010-08-29 06:21:45 +0000 (Sun, 29 Aug 2010) Log Message: ----------- don't show sample *.class files (svnignore) Property Changed: ---------------- trunk/fb-contrib/samples/ Property changes on: trunk/fb-contrib/samples ___________________________________________________________________ Modified: svn:ignore - "*.class" + *.class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-29 06:15:14
|
Revision: 1594 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1594&view=rev Author: dbrosius Date: 2010-08-29 06:15:07 +0000 (Sun, 29 Aug 2010) Log Message: ----------- remove javadoc from svn Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml Added Paths: ----------- trunk/fb-contrib/samples/SEC_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java Removed Paths: ------------- trunk/fb-contrib/javadoc/ Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-08-29 05:31:24 UTC (rev 1593) +++ trunk/fb-contrib/etc/findbugs.xml 2010-08-29 06:15:07 UTC (rev 1594) @@ -211,6 +211,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleUnsuspectedSerialization" speed="fast" reports="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor" speed="fast" reports="SEC_SIDE_EFFECT_CONSTRUCTOR" /> + <!-- BugPattern --> <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> @@ -369,5 +371,6 @@ <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_LOCAL" category="CORRECTNESS" /> <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_FIELD" category="CORRECTNESS" /> <BugPattern abbrev="UVA" type="UVA_USE_VAR_ARGS" category="STYLE" /> - <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" /> + <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="SEC" type="SEC_SIDE_EFFECT_CONSTRUCTOR" category="STYLE" experimental="true" /> </FindbugsPlugin> \ No newline at end of file Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-08-29 05:31:24 UTC (rev 1593) +++ trunk/fb-contrib/etc/messages.xml 2010-08-29 06:15:07 UTC (rev 1594) @@ -1167,6 +1167,17 @@ ]]> </Details> </Detector> + + <Detector class="com.mebigfatguy.fbcontrib.detect.SideEffectConstructor"> + <Details> + <![CDATA[ + <p>This detector looks for object creation where the object isn't assigned to any variable or + field. This implies that the class operates through side effects in the constructor, which makes + for difficult to maintain code.</p> + <p>It is a fast detector</p> + ]]> + </Details> + </Detector> <!-- BugPattern --> @@ -3188,6 +3199,19 @@ ]]> </Details> </BugPattern> + + <BugPattern type="SEC_SIDE_EFFECT_CONSTRUCTOR"> + <ShortDescription>Method uses a Side Effect Constructor</ShortDescription> + <LongDescription>Method {1} uses a Side Effect Constructor</LongDescription> + <Details> + <![CDATA[ + <p>This method creates an object but does not assign this object to any variable or field. + This implies that the class operations through side effects in the constructor, which is a + pattern to use. Consider pull the side effect out of the constructor, into a separate method, + of into the calling method. + ]]> + </Details> + </BugPattern> <!-- BugCode --> @@ -3287,4 +3311,5 @@ <BugCode abbrev="WOC">Write Only Collection</BugCode> <BugCode abbrev="UVA">Use Var Args</BugCode> <BugCode abbrev="PUS">Possible Unsuspected Serialization</BugCode> + <BugCode abbrev="SEC">Side Effect Constructor</BugCode> </MessageCollection> Added: trunk/fb-contrib/samples/SEC_Sample.java =================================================================== --- trunk/fb-contrib/samples/SEC_Sample.java (rev 0) +++ trunk/fb-contrib/samples/SEC_Sample.java 2010-08-29 06:15:07 UTC (rev 1594) @@ -0,0 +1,17 @@ +import java.util.ArrayList; +import java.util.List; + + +public class SEC_Sample +{ + public SEC_Sample(List<SEC_Sample> l) + { + l.add(this); + } + + public static void main(String[] args) + { + List<SEC_Sample> l = new ArrayList<SEC_Sample>(); + new SEC_Sample(l); + } +} Property changes on: trunk/fb-contrib/samples/SEC_Sample.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java (rev 0) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java 2010-08-29 06:15:07 UTC (rev 1594) @@ -0,0 +1,85 @@ +/* + * fb-contrib - Auxiliary detectors for Java programs + * Copyright (C) 2005-2010 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 org.apache.bcel.classfile.Code; + +import edu.umd.cs.findbugs.BugInstance; +import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.BytecodeScanningDetector; + +/** + * looks for constructors that operate through side effects, specifically + * constructors that aren't assigned to any variable or field. + */ +public class SideEffectConstructor extends BytecodeScanningDetector { + + private enum State {SAW_NOTHING, SAW_CTOR}; + private final BugReporter bugReporter; + private State state; + + /** + * constructs a SEC detector given the reporter to report bugs on + * + * @param bugReporter the sync of bug reports + */ + public SideEffectConstructor(BugReporter bugReporter) { + this.bugReporter = bugReporter; + } + + /** + * overrides the visitor to reset the state + * + * @param obj the context object of the currently parsed code + */ + @Override + public void visitCode(Code obj) { + state = State.SAW_NOTHING; + super.visitCode(obj); + } + /** + * overrides the visitor to look for constructors who's value is + * popped off the stack, and not assigned. + * + * @param seen the opcode of the currently parse opcode + */ + @Override + public void sawOpcode(int seen) { + switch (state) { + case SAW_NOTHING: + if (seen == INVOKESPECIAL) { + String name = getNameConstantOperand(); + if ("<init>".equals(name)) { + state = State.SAW_CTOR; + } + } + break; + + case SAW_CTOR: + if (seen == POP) { + bugReporter.reportBug(new BugInstance(this, "SEC_SIDE_EFFECT_CONSTRUCTOR", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLine(this)); + } + state = State.SAW_NOTHING; + break; + } + } +} Property changes on: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.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...> - 2010-08-29 05:31:32
|
Revision: 1593 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1593&view=rev Author: dbrosius Date: 2010-08-29 05:31:24 +0000 (Sun, 29 Aug 2010) Log Message: ----------- document PUS Modified Paths: -------------- trunk/fb-contrib/htdocs/index.shtml Modified: trunk/fb-contrib/htdocs/index.shtml =================================================================== --- trunk/fb-contrib/htdocs/index.shtml 2010-08-29 03:25:48 UTC (rev 1592) +++ trunk/fb-contrib/htdocs/index.shtml 2010-08-29 05:31:24 UTC (rev 1593) @@ -73,9 +73,9 @@ </div> <hr/> - <img id="svn_image" src="flip1.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> + <img id="svn_image" src="flip2.gif" onClick="toggleBlock('svn', 'svn_image');" align="top"/> Detectors added in svn<br/> - <div id="svn" style="display:none"> + <div id="svn" style="display:block;"> <ul> <li><b>[CVAA] ContraVariant Array Assignment</b><br/> Looks for contravariant array assignments. Since arrays are mutable data structures, their use @@ -88,12 +88,16 @@ check. Instead it references another object of the same type. It is likely that null check is being done on the wrong variable, either because of a copy/paste error, or a change in implementation.</li> + <li><b>[PUS] Possible Unsuspected Serialization</b><br/> + Looks for serialization of non-static inner classes. As this serializes + the enclosing class, it may unintentially bring in more to the serialization + than is wanted.</li> </ul> </div> <hr/> - <img id="v4_4_0_image" src="flip2.gif" onClick="toggleBlock('v4_4_0', 'v4_4_0_image');" align="top"/> + <img id="v4_4_0_image" src="flip1.gif" onClick="toggleBlock('v4_4_0', 'v4_4_0_image');" align="top"/> Detectors added in v4.4.0<br/> - <div id="v4_4_0" style="display:block;"> + <div id="v4_4_0" style="display:none;"> <ul> <li><b>[ROOM] Reflection on Object Methods</b><br/> Looks for method calls through reflection on methods found in java.lang.Object. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-29 03:25:54
|
Revision: 1592 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1592&view=rev Author: dbrosius Date: 2010-08-29 03:25:48 +0000 (Sun, 29 Aug 2010) Log Message: ----------- guard against NPEs Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java 2010-08-28 01:33:41 UTC (rev 1591) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java 2010-08-29 03:25:48 UTC (rev 1592) @@ -90,7 +90,7 @@ OpcodeStack.Item item = stack.getStackItem(0); JavaClass cls = item.getJavaClass(); - if (cls.getClassName().contains("$") && hasOuterClassSyntheticReference(cls)) { + if ((cls != null) && cls.getClassName().contains("$") && hasOuterClassSyntheticReference(cls)) { bugReporter.reportBug(new BugInstance(this, "PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION", NORMAL_PRIORITY) .addClass(this) .addMethod(this) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2010-08-28 01:33:50
|
Revision: 1591 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1591&view=rev Author: dbrosius Date: 2010-08-28 01:33:41 +0000 (Sat, 28 Aug 2010) Log Message: ----------- new detector: PUS Modified Paths: -------------- trunk/fb-contrib/etc/findbugs.xml trunk/fb-contrib/etc/messages.xml Added Paths: ----------- trunk/fb-contrib/samples/PUS_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleUnsuspectedSerialization.java Modified: trunk/fb-contrib/etc/findbugs.xml =================================================================== --- trunk/fb-contrib/etc/findbugs.xml 2010-08-22 04:43:28 UTC (rev 1590) +++ trunk/fb-contrib/etc/findbugs.xml 2010-08-28 01:33:41 UTC (rev 1591) @@ -1,12 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> - <!-- - Plugin descriptor for fb-contrib plugin. This plugin is enabled by - default. - --> -<FindbugsPlugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="findbugsplugin.xsd" pluginid="com.mebigfatguy.fbcontrib" - defaultenabled="true" provider="fb-contrib project" website="http://fb-contrib.sourceforge.net"> +<!-- Plugin descriptor for fb-contrib plugin. This plugin is enabled by default. --> +<FindbugsPlugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="findbugsplugin.xsd" pluginid="com.mebigfatguy.fbcontrib" defaultenabled="true" + provider="fb-contrib project" website="http://fb-contrib.sourceforge.net"> <!-- Passes --> @@ -19,628 +15,359 @@ <!-- Detectors --> - <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" - speed="fast" reports="" hidden="true" /> + <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics" speed="fast" reports="" hidden="true" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering" - speed="fast" reports="ISB_INEFFICIENT_STRING_BUFFERING,ISB_EMPTY_STRING_APPENDING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering" speed="fast" reports="ISB_INEFFICIENT_STRING_BUFFERING,ISB_EMPTY_STRING_APPENDING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SyncCollectionIterators" - speed="slow" reports="SCI_SYNCHRONIZED_COLLECTION_ITERATORS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SyncCollectionIterators" speed="slow" reports="SCI_SYNCHRONIZED_COLLECTION_ITERATORS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.CyclomaticComplexity" - speed="slow" reports="CC_CYCLOMATIC_COMPLEXITY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.CyclomaticComplexity" speed="slow" reports="CC_CYCLOMATIC_COMPLEXITY" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyConcreteParameter" - speed="slow" reports="OCP_OVERLY_CONCRETE_PARAMETER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyConcreteParameter" speed="slow" reports="OCP_OVERLY_CONCRETE_PARAMETER" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ListIndexedIterating" - speed="moderate" reports="LII_LIST_INDEXED_ITERATING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ListIndexedIterating" speed="moderate" reports="LII_LIST_INDEXED_ITERATING" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents" - speed="fast" reports="UCC_UNRELATED_COLLECTION_CONTENTS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents" speed="fast" reports="UCC_UNRELATED_COLLECTION_CONTENTS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException" - speed="fast" reports="DRE_DECLARED_RUNTIME_EXCEPTION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException" speed="fast" reports="DRE_DECLARED_RUNTIME_EXCEPTION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy" - speed="fast" reports="CE_CLASS_ENVY" disabled="true" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy" speed="fast" reports="CE_CLASS_ENVY" disabled="true" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison" - speed="fast" reports="LSC_LITERAL_STRING_COMPARISON" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison" speed="fast" reports="LSC_LITERAL_STRING_COMPARISON" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.PartiallyConstructedObjectAccess" - speed="fast" reports="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.PartiallyConstructedObjectAccess" speed="fast" reports="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousListCollection" - speed="fast" reports="DLC_DUBIOUS_LIST_COLLECTION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousListCollection" speed="fast" reports="DLC_DUBIOUS_LIST_COLLECTION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ParallelLists" - speed="fast" reports="PL_PARALLEL_LISTS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ParallelLists" speed="fast" reports="PL_PARALLEL_LISTS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters" - speed="slow" reports="FP_FINAL_PARAMETERS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters" speed="slow" reports="FP_FINAL_PARAMETERS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.AbstractClassEmptyMethods" - speed="fast" reports="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.AbstractClassEmptyMethods" speed="fast" reports="ACEM_ABSTRACT_CLASS_EMPTY_METHODS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ManualArrayCopy" - speed="fast" reports="MAC_MANUAL_ARRAY_COPY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ManualArrayCopy" speed="fast" reports="MAC_MANUAL_ARRAY_COPY" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.FloatingPointLoops" - speed="fast" reports="FPL_FLOATING_POINT_LOOPS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.FloatingPointLoops" speed="fast" reports="FPL_FLOATING_POINT_LOOPS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" - speed="fast" reports="NCMU_NON_COLLECTION_METHOD_USE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonCollectionMethodUse" speed="fast" reports="NCMU_NON_COLLECTION_METHOD_USE" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading" - speed="fast" reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingAutoboxedOverloading" speed="fast" reports="CAO_CONFUSING_AUTOBOXED_OVERLOADING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.AbnormalFinallyBlockReturn" - speed="fast" reports="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.AbnormalFinallyBlockReturn" speed="fast" reports="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.StaticMethodInstanceInvocation" - speed="fast" reports="SMII_STATIC_METHOD_INSTANCE_INVOCATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.StaticMethodInstanceInvocation" speed="fast" reports="SMII_STATIC_METHOD_INSTANCE_INVOCATION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SpuriousThreadStates" - speed="fast" reports="STS_SPURIOUS_THREAD_STATES" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SpuriousThreadStates" speed="fast" reports="STS_SPURIOUS_THREAD_STATES" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessAutoboxing" - speed="fast" + <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessAutoboxing" speed="fast" reports="NAB_NEEDLESS_AUTOBOXING_CTOR,NAB_NEEDLESS_BOXING_STRING_CTOR,NAB_NEEDLESS_AUTOBOXING_VALUEOF,NAB_NEEDLESS_BOXING_PARSE,NAB_NEEDLESS_BOXING_VALUEOF,NAB_NEEDLESS_BOX_TO_UNBOX,NAB_NEEDLESS_BOX_TO_CAST,NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn" - speed="fast" reports="USBR_UNNECESSARY_STORE_BEFORE_RETURN" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryStoreBeforeReturn" speed="fast" reports="USBR_UNNECESSARY_STORE_BEFORE_RETURN" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" - speed="fast" reports="COM_COPIED_OVERRIDDEN_METHOD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.CopiedOverriddenMethod" speed="fast" reports="COM_COPIED_OVERRIDDEN_METHOD" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections" - speed="fast" reports="ABC_ARRAY_BASED_COLLECTIONS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayBasedCollections" speed="fast" reports="ABC_ARRAY_BASED_COLLECTIONS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.OrphanedDOMNode" - speed="fast" reports="ODN_ORPHANED_DOM_NODE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.OrphanedDOMNode" speed="fast" reports="ODN_ORPHANED_DOM_NODE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.AbstractOverriddenMethod" - speed="fast" reports="AOM_ABSTRACT_OVERRIDDEN_METHOD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.AbstractOverriddenMethod" speed="fast" reports="AOM_ABSTRACT_OVERRIDDEN_METHOD" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.CustomBuiltXML" - speed="fast" reports="CBX_CUSTOM_BUILT_XML" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.CustomBuiltXML" speed="fast" reports="CBX_CUSTOM_BUILT_XML" /> -<!-- - <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock" - speed="fast" reports="BSB_BLOATED_SYNCHRONIZED_BLOCK" hidden="true" /> ---> - <Detector class="com.mebigfatguy.fbcontrib.detect.ConstantListIndex" - speed="fast" reports="CLI_CONSTANT_LIST_INDEX" /> + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedSynchronizedBlock" speed="fast" reports="BSB_BLOATED_SYNCHRONIZED_BLOCK" hidden="true" /> --> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConstantListIndex" speed="fast" reports="CLI_CONSTANT_LIST_INDEX" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SloppyClassReflection" - speed="fast" reports="SCR_SLOPPY_CLASS_REFLECTION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SloppyClassReflection" speed="fast" reports="SCR_SLOPPY_CLASS_REFLECTION" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.ArrayWrappedCallByReference" - speed="fast" reports="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ArrayWrappedCallByReference" speed="fast" reports="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SluggishGui" - speed="fast" reports="SG_SLUGGISH_GUI" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SluggishGui" speed="fast" reports="SG_SLUGGISH_GUI" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval" - speed="fast" reports="NIR_NEEDLESS_INSTANCE_RETRIEVAL" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessInstanceRetrieval" speed="fast" reports="NIR_NEEDLESS_INSTANCE_RETRIEVAL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison" - speed="fast" reports="DDC_DOUBLE_DATE_COMPARISON" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.DateComparison" speed="fast" reports="DDC_DOUBLE_DATE_COMPARISON" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.SuspiciousWaitOnConcurrentObject" - speed="fast" reports="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousWaitOnConcurrentObject" speed="fast" reports="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.JDBCVendorReliance" - speed="fast" reports="JVR_JDBC_VENDOR_RELIANCE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.JDBCVendorReliance" speed="fast" reports="JVR_JDBC_VENDOR_RELIANCE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat" - speed="fast" reports="PMB_POSSIBLE_MEMORY_BLOAT" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleMemoryBloat" speed="fast" reports="PMB_POSSIBLE_MEMORY_BLOAT" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection" - speed="moderate" reports="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LocalSynchronizedCollection" speed="moderate" reports="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal" - speed="slow" reports="FCBL_FIELD_COULD_BE_LOCAL" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.FieldCouldBeLocal" speed="slow" reports="FCBL_FIELD_COULD_BE_LOCAL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NonOwnedSynchronization" - speed="fast" reports="NOS_NON_OWNED_SYNCHRONIZATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonOwnedSynchronization" speed="fast" reports="NOS_NON_OWNED_SYNCHRONIZATION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NonRecycleableTaglibs" - speed="fast" reports="NRTL_NON_RECYCLEABLE_TAG_LIBS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonRecycleableTaglibs" speed="fast" reports="NRTL_NON_RECYCLEABLE_TAG_LIBS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.Section508Compliance" - speed="fast" + <Detector class="com.mebigfatguy.fbcontrib.detect.Section508Compliance" speed="fast" reports="S508C_NULL_LAYOUT,S508C_NO_SETLABELFOR,S508C_NO_SETSIZE,S508C_NON_ACCESSIBLE_JCOMPONENT,S508C_SET_COMP_COLOR,S508C_NON_TRANSLATABLE_STRING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UseEnumCollections" - speed="fast" reports="UEC_USE_ENUM_COLLECTIONS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UseEnumCollections" speed="fast" reports="UEC_USE_ENUM_COLLECTIONS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SQLInLoop" - speed="fast" reports="SIL_SQL_IN_LOOP" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SQLInLoop" speed="fast" reports="SIL_SQL_IN_LOOP" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.NeedlessMemberCollectionSynchronization" - speed="moderate" reports="NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessMemberCollectionSynchronization" speed="moderate" reports="NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InheritanceTypeChecking" - speed="moderate" reports="ITC_INHERITANCE_TYPE_CHECKING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.InheritanceTypeChecking" speed="moderate" reports="ITC_INHERITANCE_TYPE_CHECKING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.StaticArrayCreatedInMethod" - speed="fast" reports="SACM_STATIC_ARRAY_CREATED_IN_METHOD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.StaticArrayCreatedInMethod" speed="fast" reports="SACM_STATIC_ARRAY_CREATED_IN_METHOD" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.PossiblyRedundantMethodCalls" - speed="fast" reports="PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.PossiblyRedundantMethodCalls" speed="fast" reports="PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UseToArray" - speed="fast" reports="UTA_USE_TO_ARRAY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UseToArray" speed="fast" reports="UTA_USE_TO_ARRAY" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.LostExceptionStackTrace" - speed="moderate" reports="LEST_LOST_EXCEPTION_STACK_TRACE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LostExceptionStackTrace" speed="moderate" reports="LEST_LOST_EXCEPTION_STACK_TRACE" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.UseCharacterParameterizedMethod" - speed="fast" reports="UCPM_USE_CHARACTER_PARAMETERIZED_METHOD" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UseCharacterParameterizedMethod" speed="fast" reports="UCPM_USE_CHARACTER_PARAMETERIZED_METHOD" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.TailRecursion" - speed="fast" reports="TR_TAIL_RECURSION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.TailRecursion" speed="fast" reports="TR_TAIL_RECURSION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedReturnValues" - speed="fast" - reports="URV_UNRELATED_RETURN_VALUES,URV_CHANGE_RETURN_TYPE,URV_INHERITED_METHOD_WITH_RELATED_TYPES" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedReturnValues" speed="fast" reports="URV_UNRELATED_RETURN_VALUES,URV_CHANGE_RETURN_TYPE,URV_INHERITED_METHOD_WITH_RELATED_TYPES" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization" - speed="fast" reports="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleIncompleteSerialization" speed="fast" reports="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" - speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousComparatorReturnValues" speed="fast" reports="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" - speed="fast" + <Detector class="com.mebigfatguy.fbcontrib.detect.SillynessPotPourri" speed="fast" reports="SPP_NEGATIVE_BITSET_ITEM,SPP_INTERN_ON_CONSTANT,SPP_NO_CHAR_SB_CTOR,SPP_USE_MATH_CONSTANT,SPP_STUTTERED_ASSIGNMENT,SPP_USE_ISNAN,SPP_USE_BIGDECIMAL_STRING_CTOR,SPP_STRINGBUFFER_WITH_EMPTY_STRING,SPP_EQUALS_ON_ENUM,SPP_INVALID_BOOLEAN_NULL_CHECK,SPP_USE_CHARAT,SPP_USELESS_TRINARY,SPP_SUSPECT_STRING_TEST,SPP_USE_STRINGBUILDER_LENGTH,SPP_INVALID_CALENDAR_COMPARE,SPP_USE_CONTAINSKEY,SPP_USE_ISEMPTY,SPP_USE_GETPROPERTY,SPP_USELESS_CASING,SPP_NON_ARRAY_PARM" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" - speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.BloatedAssignmentScope" speed="fast" reports="BAS_BLOATED_ASSIGNMENT_SCOPE" hidden="true" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" - speed="fast" reports="SCI_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SpoiledChildInterfaceImplementor" speed="fast" reports="SCI_SPOILED_CHILD_INTERFACE_IMPLEMENTOR" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating" - speed="fast" reports="DWI_DELETING_WHILE_ITERATING,DWI_MODIFYING_WHILE_ITERATING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.DeletingWhileIterating" speed="fast" reports="DWI_DELETING_WHILE_ITERATING,DWI_MODIFYING_WHILE_ITERATING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UseSplit" - speed="fast" reports="USS_USE_STRING_SPLIT" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UseSplit" speed="fast" reports="USS_USE_STRING_SPLIT" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse" - speed="slow" reports="SJVU_SUSPICIOUS_JDK_VERSION_USE" disabled="true" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousJDKVersionUse" speed="slow" reports="SJVU_SUSPICIOUS_JDK_VERSION_USE" disabled="true" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UseAddAll" - speed="fast" reports="UAA_USE_ADD_ALL" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UseAddAll" speed="fast" reports="UAA_USE_ADD_ALL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant" - speed="fast" reports="MRC_METHOD_RETURNS_CONSTANT" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.MethodReturnsConstant" speed="fast" reports="MRC_METHOD_RETURNS_CONSTANT" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.NeedlessCustomSerialization" - speed="fast" reports="NCS_NEEDLESS_CUSTOM_SERIALIZATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NeedlessCustomSerialization" speed="fast" reports="NCS_NEEDLESS_CUSTOM_SERIALIZATION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.MisleadingOverloadModel" - speed="fast" reports="MOM_MISLEADING_OVERLOAD_MODEL" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.MisleadingOverloadModel" speed="fast" reports="MOM_MISLEADING_OVERLOAD_MODEL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ExceptionSoftening" - speed="moderate" - reports="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS,EXS_EXCEPTION_SOFTENING_HAS_CHECKED,EXS_EXCEPTION_SOFTENING_NO_CHECKED" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ExceptionSoftening" speed="moderate" reports="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS,EXS_EXCEPTION_SOFTENING_HAS_CHECKED,EXS_EXCEPTION_SOFTENING_NO_CHECKED" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics" - speed="fast" reports="CFS_CONFUSING_FUNCTION_SEMANTICS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ConfusingFunctionSemantics" speed="fast" reports="CFS_CONFUSING_FUNCTION_SEMANTICS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities" - speed="fast" + <Detector class="com.mebigfatguy.fbcontrib.detect.JUnitAssertionOddities" speed="fast" reports="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT,JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE,JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT,JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm" - speed="fast" reports="SCA_SUSPICIOUS_CLONE_ALGORITHM" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousCloneAlgorithm" speed="fast" reports="SCA_SUSPICIOUS_CLONE_ALGORITHM" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging" - speed="fast" reports="WEM_WEAK_EXCEPTION_MESSAGING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.WeakExceptionMessaging" speed="fast" reports="WEM_WEAK_EXCEPTION_MESSAGING" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" - speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousClusteredSessionSupport" speed="fast" reports="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" - speed="fast" reports="LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.LoggerOddities" speed="fast" reports="LO_SUSPECT_LOG_CLASS,LO_SUSPECT_LOG_PARAMETER" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" - speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.IncorrectInternalClassUse" speed="fast" reports="IICU_INCORRECT_INTERNAL_CLASS_USE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousSetOfCollections" - speed="moderate" reports="DSOC_DUBIOUS_SET_OF_COLLECTIONS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousSetOfCollections" speed="moderate" reports="DSOC_DUBIOUS_SET_OF_COLLECTIONS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.BogusExceptionDeclaration" - speed="moderate" reports="BED_BOGUS_EXCEPTION_DECLARATION" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.BogusExceptionDeclaration" speed="moderate" reports="BED_BOGUS_EXCEPTION_DECLARATION" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryNewNullCheck" - speed="fast" reports="UNNC_UNNECESSARY_NEW_NULL_CHECK" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.UnnecessaryNewNullCheck" speed="fast" reports="UNNC_UNNECESSARY_NEW_NULL_CHECK" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.DeprecatedTypesafeEnumPattern" - speed="fast" reports="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" /> -<!-- - <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments" - speed="fast" reports="SMA_STUTTERED_METHOD_ARGUMENTS" hidden="true" /> ---> + <Detector class="com.mebigfatguy.fbcontrib.detect.DeprecatedTypesafeEnumPattern" speed="fast" reports="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" /> + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.StutteredMethodArguments" speed="fast" reports="SMA_STUTTERED_METHOD_ARGUMENTS" hidden="true" /> --> - <Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern" - speed="fast" reports="TBP_TRISTATE_BOOLEAN_PATTERN" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.TristateBooleanPattern" speed="fast" reports="TBP_TRISTATE_BOOLEAN_PATTERN" /> - <Detector - class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray" - speed="fast" reports="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousUninitializedArray" speed="fast" reports="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse" - speed="fast" reports="ITU_INAPPROPRIATE_TOSTRING_USE" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.InappropriateToStringUse" speed="fast" reports="ITU_INAPPROPRIATE_TOSTRING_USE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing" - speed="fast" reports="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING,IKNC_INCONSISTENT_HTTP_PARAM_CASING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.InconsistentKeyNameCasing" speed="fast" reports="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING,IKNC_INCONSISTENT_HTTP_PARAM_CASING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.OverzealousCasting" - speed="fast" reports="OC_OVERZEALOUS_CASTING" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.OverzealousCasting" speed="fast" reports="OC_OVERZEALOUS_CASTING" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.PoorlyDefinedParameter" - speed="fast" reports="PDP_POORLY_DEFINED_PARAMETER" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.PoorlyDefinedParameter" speed="fast" reports="PDP_POORLY_DEFINED_PARAMETER" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.NonSymmetricEquals" - speed="fast" reports="NSE_NON_SYMMETRIC_EQUALS" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.NonSymmetricEquals" speed="fast" reports="NSE_NON_SYMMETRIC_EQUALS" /> -<!-- - <Detector - class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" - speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> - --> - - <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" - speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> -<!-- - <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" - speed="fast" hidden="true" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> ---> - <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" - speed="fast" + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.ContraVariantArrayAssignment" speed="fast" hidden="true" reports="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT,CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" /> --> + + <Detector class="com.mebigfatguy.fbcontrib.detect.NonFunctionalField" speed="fast" reports="NFF_NON_FUNCTIONAL_FIELD" /> + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.SuspiciousNullGuard" speed="fast" hidden="true" reports="SNG_SUSPICIOUS_NULL_FIELD_GUARD,SNG_SUSPICIOUS_NULL_LOCAL_GUARD" /> --> + <Detector class="com.mebigfatguy.fbcontrib.detect.MoreDumbMethods" speed="fast" reports="MDM_RUNTIME_EXIT_OR_HALT,MDM_RUNFINALIZATION,MDM_BIGDECIMAL_EQUALS,MDM_INETADDRESS_GETLOCALHOST,MDM_PROMISCUOUS_SERVERSOCKET,MDM_RANDOM_SEED,MDM_SECURERANDOM_CTOR,MDM_SECURERANDOM_GETSEED,MDM_THREAD_PRIORITIES,MDM_THREAD_YIELD,MDM_WAIT_WITHOUT_TIMEOUT,MDM_THREAD_FAIRNESS,MDM_REENTRANTLOCK_HELDBY,MDM_STRING_BYTES_ENCODING,MDM_SETDEFAULTLOCALE" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods" - speed="fast" - reports="ROOM_REFLECTION_ON_OBJECT_METHODS" /> - - <Detector class="com.mebigfatguy.fbcontrib.detect.ImproperPropertiesUse" - speed="fast" - reports="IPU_IMPROPER_PROPERTIES_USE,IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY" /> + <Detector class="com.mebigfatguy.fbcontrib.detect.ReflectionOnObjectMethods" speed="fast" reports="ROOM_REFLECTION_ON_OBJECT_METHODS" /> - <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleConstantAllocationInLoop" - speed="fast" - reports="PCAIL_POSSIBLE_CONSTANT_ALLOCATION_IN_LOOP" /> - - <Detector class="com.mebigfatguy.fbcontrib.detect.WriteOnlyCollection" - speed="fast" - reports="WOC_WRITE_ONLY_COLLECTION_LOCAL,WOC_WRITE_ONLY_COLLECTION_FIELD" /> - - <Detector class="com.mebigfatguy.fbcontrib.detect.UseVarArgs" - speed="fast" - reports="UVA_USE_VAR_ARGS" /> - + <Detector class="com.mebigfatguy.fbcontrib.detect.ImproperPropertiesUse" speed="fast" reports="IPU_IMPROPER_PROPERTIES_USE,IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleConstantAllocationInLoop" speed="fast" reports="PCAIL_POSSIBLE_CONSTANT_ALLOCATION_IN_LOOP" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.WriteOnlyCollection" speed="fast" reports="WOC_WRITE_ONLY_COLLECTION_LOCAL,WOC_WRITE_ONLY_COLLECTION_FIELD" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.UseVarArgs" speed="fast" reports="UVA_USE_VAR_ARGS" /> + + <Detector class="com.mebigfatguy.fbcontrib.detect.PossibleUnsuspectedSerialization" speed="fast" reports="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" /> + <!-- BugPattern --> - <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" - category="PERFORMANCE" /> - <BugPattern abbrev="ISB" type="ISB_EMPTY_STRING_APPENDING" - category="PERFORMANCE" /> - <BugPattern abbrev="SCI" type="SCI_SYNCHRONIZED_COLLECTION_ITERATORS" - category="CORRECTNESS" /> - <BugPattern abbrev="CC" type="CC_CYCLOMATIC_COMPLEXITY" - category="STYLE" /> - <BugPattern abbrev="OCP" type="OCP_OVERLY_CONCRETE_PARAMETER" - category="STYLE" /> - <BugPattern abbrev="LII" type="LII_LIST_INDEXED_ITERATING" - category="STYLE" /> - <BugPattern abbrev="UCC" type="UCC_UNRELATED_COLLECTION_CONTENTS" - category="STYLE" /> - <BugPattern abbrev="DRE" type="DRE_DECLARED_RUNTIME_EXCEPTION" - category="STYLE" /> - <BugPattern abbrev="CE" type="CE_CLASS_ENVY" category="STYLE" - experimental="true" /> - <BugPattern abbrev="LSC" type="LSC_LITERAL_STRING_COMPARISON" - category="STYLE" /> - <BugPattern abbrev="PCOA" - type="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" category="CORRECTNESS" /> - <BugPattern abbrev="DLC" type="DLC_DUBIOUS_LIST_COLLECTION" - category="PERFORMANCE" /> + <BugPattern abbrev="ISB" type="ISB_INEFFICIENT_STRING_BUFFERING" category="PERFORMANCE" /> + <BugPattern abbrev="ISB" type="ISB_EMPTY_STRING_APPENDING" category="PERFORMANCE" /> + <BugPattern abbrev="SCI" type="SCI_SYNCHRONIZED_COLLECTION_ITERATORS" category="CORRECTNESS" /> + <BugPattern abbrev="CC" type="CC_CYCLOMATIC_COMPLEXITY" category="STYLE" /> + <BugPattern abbrev="OCP" type="OCP_OVERLY_CONCRETE_PARAMETER" category="STYLE" /> + <BugPattern abbrev="LII" type="LII_LIST_INDEXED_ITERATING" category="STYLE" /> + <BugPattern abbrev="UCC" type="UCC_UNRELATED_COLLECTION_CONTENTS" category="STYLE" /> + <BugPattern abbrev="DRE" type="DRE_DECLARED_RUNTIME_EXCEPTION" category="STYLE" /> + <BugPattern abbrev="CE" type="CE_CLASS_ENVY" category="STYLE" experimental="true" /> + <BugPattern abbrev="LSC" type="LSC_LITERAL_STRING_COMPARISON" category="STYLE" /> + <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" /> - <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" /> - <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERLOADING" - category="CORRECTNESS" /> - <BugPattern abbrev="AFBR" type="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN" - category="CORRECTNESS" /> - <BugPattern abbrev="SMII" type="SMII_STATIC_METHOD_INSTANCE_INVOCATION" - category="STYLE" /> - <BugPattern abbrev="STS" type="STS_SPURIOUS_THREAD_STATES" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING_CTOR" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_STRING_CTOR" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING_VALUEOF" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_PARSE" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_VALUEOF" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOX_TO_UNBOX" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOX_TO_CAST" - category="PERFORMANCE" /> - <BugPattern abbrev="NAB" - type="NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION" category="PERFORMANCE" /> - <BugPattern abbrev="USBR" type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" - category="STYLE" /> - <BugPattern abbrev="COM" type="COM_COPIED_OVERRIDDEN_METHOD" - category="STYLE" /> - <BugPattern abbrev="ABC" type="ABC_ARRAY_BASED_COLLECTIONS" - category="CORRECTNESS" /> - <BugPattern abbrev="ODN" type="ODN_ORPHANED_DOM_NODE" - category="CORRECTNESS" /> - <BugPattern abbrev="AOM" type="AOM_ABSTRACT_OVERRIDDEN_METHOD" - category="CORRECTNESS" /> - <BugPattern abbrev="CBX" type="CBX_CUSTOM_BUILT_XML" - category="STYLE" /> - <BugPattern abbrev="BSB" type="BSB_BLOATED_SYNCHRONIZED_BLOCK" - category="PERFORMANCE" experimental="true" /> - <BugPattern abbrev="CLI" type="CLI_CONSTANT_LIST_INDEX" - category="CORRECTNESS" /> - <BugPattern abbrev="SCR" type="SCR_SLOPPY_CLASS_REFLECTION" - category="STYLE" /> - <BugPattern abbrev="AWCBR" type="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE" - 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" /> + <BugPattern abbrev="NCMU" type="NCMU_NON_COLLECTION_METHOD_USE" category="STYLE" /> + <BugPattern abbrev="CAO" type="CAO_CONFUSING_AUTOBOXED_OVERLOADING" category="CORRECTNESS" /> + <BugPattern abbrev="AFBR" type="AFBR_ABNORMAL_FINALLY_BLOCK_RETURN" category="CORRECTNESS" /> + <BugPattern abbrev="SMII" type="SMII_STATIC_METHOD_INSTANCE_INVOCATION" category="STYLE" /> + <BugPattern abbrev="STS" type="STS_SPURIOUS_THREAD_STATES" category="MT_CORRECTNESS" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING_CTOR" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_STRING_CTOR" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_AUTOBOXING_VALUEOF" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_PARSE" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOXING_VALUEOF" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOX_TO_UNBOX" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOX_TO_CAST" category="PERFORMANCE" /> + <BugPattern abbrev="NAB" type="NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION" category="PERFORMANCE" /> + <BugPattern abbrev="USBR" type="USBR_UNNECESSARY_STORE_BEFORE_RETURN" category="STYLE" /> + <BugPattern abbrev="COM" type="COM_COPIED_OVERRIDDEN_METHOD" category="STYLE" /> + <BugPattern abbrev="ABC" type="ABC_ARRAY_BASED_COLLECTIONS" category="CORRECTNESS" /> + <BugPattern abbrev="ODN" type="ODN_ORPHANED_DOM_NODE" category="CORRECTNESS" /> + <BugPattern abbrev="AOM" type="AOM_ABSTRACT_OVERRIDDEN_METHOD" category="CORRECTNESS" /> + <BugPattern abbrev="CBX" type="CBX_CUSTOM_BUILT_XML" category="STYLE" /> + <BugPattern abbrev="BSB" type="BSB_BLOATED_SYNCHRONIZED_BLOCK" category="PERFORMANCE" experimental="true" /> + <BugPattern abbrev="CLI" type="CLI_CONSTANT_LIST_INDEX" category="CORRECTNESS" /> + <BugPattern abbrev="SCR" type="SCR_SLOPPY_CLASS_REFLECTION" category="STYLE" /> + <BugPattern abbrev="AWCBR" type="AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE" category="STYLE" /> <BugPattern abbrev="SG" type="SG_SLUGGISH_GUI" category="PERFORMANCE" /> - <BugPattern abbrev="NIR" type="NIR_NEEDLESS_INSTANCE_RETRIEVAL" - category="PERFORMANCE" /> - <BugPattern abbrev="DDC" type="DDC_DOUBLE_DATE_COMPARISON" - category="PERFORMANCE" /> - <BugPattern abbrev="SWCO" - type="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT" category="CORRECTNESS" /> - <BugPattern abbrev="JVR" type="JVR_JDBC_VENDOR_RELIANCE" - category="CORRECTNESS" /> - <BugPattern abbrev="PMB" type="PMB_POSSIBLE_MEMORY_BLOAT" - category="CORRECTNESS" /> - <BugPattern abbrev="LSYC" type="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" - category="CORRECTNESS" /> - <BugPattern abbrev="FCBL" type="FCBL_FIELD_COULD_BE_LOCAL" - category="CORRECTNESS" /> - <BugPattern abbrev="NOS" type="NOS_NON_OWNED_SYNCHRONIZATION" - category="STYLE" /> - <BugPattern abbrev="NRTL" type="NRTL_NON_RECYCLEABLE_TAG_LIB" - category="CORRECTNESS" /> - <BugPattern abbrev="S508C" type="S508C_NULL_LAYOUT" - category="CORRECTNESS" /> - <BugPattern abbrev="S508C" type="S508C_NO_SETLABELFOR" - category="CORRECTNESS" /> + <BugPattern abbrev="NIR" type="NIR_NEEDLESS_INSTANCE_RETRIEVAL" category="PERFORMANCE" /> + <BugPattern abbrev="DDC" type="DDC_DOUBLE_DATE_COMPARISON" category="PERFORMANCE" /> + <BugPattern abbrev="SWCO" type="SWCO_SUSPICIOUS_WAIT_ON_CONCURRENT_OBJECT" category="CORRECTNESS" /> + <BugPattern abbrev="JVR" type="JVR_JDBC_VENDOR_RELIANCE" category="CORRECTNESS" /> + <BugPattern abbrev="PMB" type="PMB_POSSIBLE_MEMORY_BLOAT" category="CORRECTNESS" /> + <BugPattern abbrev="LSYC" type="LSYC_LOCAL_SYNCHRONIZED_COLLECTION" category="CORRECTNESS" /> + <BugPattern abbrev="FCBL" type="FCBL_FIELD_COULD_BE_LOCAL" category="CORRECTNESS" /> + <BugPattern abbrev="NOS" type="NOS_NON_OWNED_SYNCHRONIZATION" category="STYLE" /> + <BugPattern abbrev="NRTL" type="NRTL_NON_RECYCLEABLE_TAG_LIB" category="CORRECTNESS" /> + <BugPattern abbrev="S508C" type="S508C_NULL_LAYOUT" category="CORRECTNESS" /> + <BugPattern abbrev="S508C" type="S508C_NO_SETLABELFOR" category="CORRECTNESS" /> <BugPattern abbrev="S508C" type="S508C_NO_SETSIZE" category="CORRECTNESS" /> - <BugPattern abbrev="S508C" type="S508C_NON_ACCESSIBLE_JCOMPONENT" - category="CORRECTNESS" /> - <BugPattern abbrev="S508C" type="S508C_SET_COMP_COLOR" - category="CORRECTNESS" /> - <BugPattern abbrev="S508C" type="S508C_NON_TRANSLATABLE_STRING" - category="CORRECTNESS" /> - <BugPattern abbrev="UEC" type="UEC_USE_ENUM_COLLECTIONS" - category="PERFORMANCE" /> + <BugPattern abbrev="S508C" type="S508C_NON_ACCESSIBLE_JCOMPONENT" category="CORRECTNESS" /> + <BugPattern abbrev="S508C" type="S508C_SET_COMP_COLOR" category="CORRECTNESS" /> + <BugPattern abbrev="S508C" type="S508C_NON_TRANSLATABLE_STRING" category="CORRECTNESS" /> + <BugPattern abbrev="UEC" type="UEC_USE_ENUM_COLLECTIONS" category="PERFORMANCE" /> <BugPattern abbrev="SIL" type="SIL_SQL_IN_LOOP" category="PERFORMANCE" /> - <BugPattern abbrev="NMCS" - type="NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION" category="PERFORMANCE" /> - <BugPattern abbrev="ITC" type="ITC_INHERITANCE_TYPE_CHECKING" - category="STYLE" /> - <BugPattern abbrev="SACM" type="SACM_STATIC_ARRAY_CREATED_IN_METHOD" - category="PERFORMANCE" /> - <BugPattern abbrev="PRMC" type="PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS" - category="PERFORMANCE" /> + <BugPattern abbrev="NMCS" type="NMCS_NEEDLESS_MEMBER_COLLECTION_SYNCHRONIZATION" category="PERFORMANCE" /> + <BugPattern abbrev="ITC" type="ITC_INHERITANCE_TYPE_CHECKING" category="STYLE" /> + <BugPattern abbrev="SACM" type="SACM_STATIC_ARRAY_CREATED_IN_METHOD" category="PERFORMANCE" /> + <BugPattern abbrev="PRMC" type="PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS" category="PERFORMANCE" /> <BugPattern abbrev="UTA" type="UTA_USE_TO_ARRAY" category="STYLE" /> - <BugPattern abbrev="LEST" type="LEST_LOST_EXCEPTION_STACK_TRACE" - category="CORRECTNESS" /> - <BugPattern abbrev="UCPM" type="UCPM_USE_CHARACTER_PARAMETERIZED_METHOD" - category="PERFORMANCE" /> + <BugPattern abbrev="LEST" type="LEST_LOST_EXCEPTION_STACK_TRACE" category="CORRECTNESS" /> + <BugPattern abbrev="UCPM" type="UCPM_USE_CHARACTER_PARAMETERIZED_METHOD" category="PERFORMANCE" /> <BugPattern abbrev="TR" type="TR_TAIL_RECURSION" category="PERFORMANCE" /> - <BugPattern abbrev="URV" type="URV_UNRELATED_RETURN_VALUES" - category="STYLE" /> - <BugPattern abbrev="URV" type="URV_CHANGE_RETURN_TYPE" - category="STYLE" /> - <BugPattern abbrev="URV" type="URV_INHERITED_METHOD_WITH_RELATED_TYPES" - category="STYLE" /> - <BugPattern abbrev="PIS" type="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" - category="CORRECTNESS" /> - <BugPattern abbrev="SCRV" type="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_NEGATIVE_BITSET_ITEM" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_INTERN_ON_CONSTANT" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_NO_CHAR_SB_CTOR" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_USE_MATH_CONSTANT" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_STUTTERED_ASSIGNMENT" - category="CORRECTNESS" /> + <BugPattern abbrev="URV" type="URV_UNRELATED_RETURN_VALUES" category="STYLE" /> + <BugPattern abbrev="URV" type="URV_CHANGE_RETURN_TYPE" category="STYLE" /> + <BugPattern abbrev="URV" type="URV_INHERITED_METHOD_WITH_RELATED_TYPES" category="STYLE" /> + <BugPattern abbrev="PIS" type="PIS_POSSIBLE_INCOMPLETE_SERIALIZATION" category="CORRECTNESS" /> + <BugPattern abbrev="SCRV" type="SC_SUSPICIOUS_COMPARATOR_RETURN_VALUES" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_NEGATIVE_BITSET_ITEM" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_INTERN_ON_CONSTANT" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_NO_CHAR_SB_CTOR" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_USE_MATH_CONSTANT" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_STUTTERED_ASSIGNMENT" category="CORRECTNESS" /> <BugPattern abbrev="SPP" type="SPP_USE_ISNAN" category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_USE_BIGDECIMAL_STRING_CTOR" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_STRINGBUFFER_WITH_EMPTY_STRING" - category="PERFORMANCE" /> + <BugPattern abbrev="SPP" type="SPP_USE_BIGDECIMAL_STRING_CTOR" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_STRINGBUFFER_WITH_EMPTY_STRING" category="PERFORMANCE" /> <BugPattern abbrev="SPP" type="SPP_EQUALS_ON_ENUM" category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_INVALID_BOOLEAN_NULL_CHECK" - category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_INVALID_BOOLEAN_NULL_CHECK" category="CORRECTNESS" /> <BugPattern abbrev="SPP" type="SPP_USE_CHARAT" category="PERFORMANCE" /> - <BugPattern abbrev="SPP" type="SPP_USELESS_TRINARY" - category="PERFORMANCE" /> - <BugPattern abbrev="SPP" type="SPP_SUSPECT_STRING_TEST" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_USE_STRINGBUILDER_LENGTH" - category="PERFORMANCE" /> - <BugPattern abbrev="SPP" type="SPP_INVALID_CALENDAR_COMPARE" - category="CORRECTNESS" /> - <BugPattern abbrev="SPP" type="SPP_USE_CONTAINSKEY" - category="STYLE" /> + <BugPattern abbrev="SPP" type="SPP_USELESS_TRINARY" category="PERFORMANCE" /> + <BugPattern abbrev="SPP" type="SPP_SUSPECT_STRING_TEST" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_USE_STRINGBUILDER_LENGTH" category="PERFORMANCE" /> + <BugPattern abbrev="SPP" type="SPP_INVALID_CALENDAR_COMPARE" category="CORRECTNESS" /> + <BugPattern abbrev="SPP" type="SPP_USE_CONTAINSKEY" category="STYLE" /> <BugPattern abbrev="SPP" type="SPP_USE_ISEMPTY" category="STYLE" /> - <BugPattern abbrev="SPP" type="SPP_USE_GETPROPERTY" - category="STYLE" /> + <BugPattern abbrev="SPP" type="SPP_USE_GETPROPERTY" category="STYLE" /> <BugPattern abbrev="SPP" type="SPP_USELESS_CASING" category="PERFORMANCE" /> - <BugPattern abbrev="SPP" type="SPP_SERIALVER_SHOULD_BE_PRIVATE" - category="STYLE" /> + <BugPattern abbrev="SPP" type="SPP_SERIALVER_SHOULD_BE_PRIVATE" category="STYLE" /> <BugPattern abbrev="SPP" type="SPP_NON_ARRAY_PARM" category="CORRECTNESS" /> - <BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" - category="PERFORMANCE" /> - <BugPattern abbrev="SCII" - type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR" category="STYLE" /> - <BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" - category="CORRECTNESS" /> - <BugPattern abbrev="DWI" type="DWI_MODIFYING_WHILE_ITERATING" - category="CORRECTNESS" /> - <BugPattern abbrev="USS" type="USS_USE_STRING_SPLIT" - category="STYLE" /> - <BugPattern abbrev="SJVU" type="SJVU_SUSPICIOUS_JDK_VERSION_USE" - category="CORRECTNESS" /> + <BugPattern abbrev="BAS" type="BAS_BLOATED_ASSIGNMENT_SCOPE" category="PERFORMANCE" /> + <BugPattern abbrev="SCII" type="SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTATOR" category="STYLE" /> + <BugPattern abbrev="DWI" type="DWI_DELETING_WHILE_ITERATING" category="CORRECTNESS" /> + <BugPattern abbrev="DWI" type="DWI_MODIFYING_WHILE_ITERATING" category="CORRECTNESS" /> + <BugPattern abbrev="USS" type="USS_USE_STRING_SPLIT" category="STYLE" /> + <BugPattern abbrev="SJVU" type="SJVU_SUSPICIOUS_JDK_VERSION_USE" category="CORRECTNESS" /> <BugPattern abbrev="UAA" type="UAA_USE_ADD_ALL" category="STYLE" /> - <BugPattern abbrev="MRC" type="MRC_METHOD_RETURNS_CONSTANT" - category="STYLE" /> - <BugPattern abbrev="NCS" type="NCS_NEEDLESS_CUSTOM_SERIALIZATION" - category="CORRECTNESS" /> - <BugPattern abbrev="MOM" type="MOM_MISLEADING_OVERLOAD_MODEL" - category="STYLE" /> - <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS" - category="STYLE" /> - <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_HAS_CHECKED" - category="STYLE" /> - <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_NO_CHECKED" - category="STYLE" /> - <BugPattern abbrev="CFS" type="CFS_CONFUSING_FUNCTION_SEMANTICS" - category="STYLE" /> - <BugPattern abbrev="JAO" - type="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT" category="STYLE" /> - <BugPattern abbrev="JAO" - type="JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE" category="STYLE" /> - <BugPattern abbrev="JAO" - type="JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT" category="STYLE" /> - <BugPattern abbrev="JAO" - type="JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" category="CORRECTNESS" /> - <BugPattern abbrev="SCA" type="SCA_SUSPICIOUS_CLONE_ALGORITHM" - category="CORRECTNESS" /> - <BugPattern abbrev="WEM" type="WEM_WEAK_EXCEPTION_MESSAGING" - category="STYLE" /> - <BugPattern abbrev="SCSS" - type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" category="CORRECTNESS" /> - <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_CLASS" - category="CORRECTNESS" /> - <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_PARAMETER" - category="CORRECTNESS" /> - <BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" - category="CORRECTNESS" /> - <BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" - category="PERFORMANCE" /> - <BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" - category="CORRECTNESS" /> - <BugPattern abbrev="UNNC" type="UNNC_UNNECESSARY_NEW_NULL_CHECK" - category="CORRECTNESS" /> - <BugPattern abbrev="DTEP" type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" - category="STYLE" /> - <BugPattern abbrev="SMA" type="SMA_STUTTERED_METHOD_ARGUMENTS" - category="STYLE" /> - <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" - category="STYLE" /> - <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" - category="CORRECTNESS" /> - <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" - category="CORRECTNESS" /> - <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING" - category="STYLE" /> - <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" - category="STYLE" /> - <BugPattern abbrev="OC" type="OC_OVERZEALOUS_CASTING" - category="CORRECTNESS" /> - <BugPattern abbrev="PDP" type="PDP_POORLY_DEFINED_PARAMETER" - category="CORRECTNESS" /> - <BugPattern abbrev="NSE" type="NSE_NON_SYMMETRIC_EQUALS" - category="CORRECTNESS" /> - <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT" - category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" - category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="NFF" type="NFF_NON_FUNCTIONAL_FIELD" - category="CORRECTNESS" /> - <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" - category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" - category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="MDM" type="MDM_RUNTIME_EXIT_OR_HALT" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_RUNFINALIZATION" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_INETADDRESS_GETLOCALHOST" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_PROMISCUOUS_SERVERSOCKET" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_THREAD_PRIORITIES" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_THREAD_YIELD" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_WAIT_WITHOUT_TIMEOUT" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_SIGNAL_NOT_SIGNALALL" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_THREAD_FAIRNESS" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_LOCK_ISLOCKED" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_STRING_BYTES_ENCODING" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_SETDEFAULTLOCALE" - category="MT_CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_BIGDECIMAL_EQUALS" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_RANDOM_SEED" - category="CORRECTNESS" /> - <BugPattern abbrev="MDM" type="MDM_SECURERANDOM" - category="CORRECTNESS" /> - <BugPattern abbrev="ROOM" type="ROOM_REFLECTION_ON_OBJECT_METHODS" - category="CORRECTNESS" /> - <BugPattern abbrev="IPU" type="IPU_IMPROPER_PROPERTIES_USE" - category="CORRECTNESS" /> - <BugPattern abbrev="IPU" type="IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY" - category="CORRECTNESS" /> - <BugPattern abbrev="PCAIL" type="PCAIL_POSSIBLE_CONSTANT_ALLOCATION_IN_LOOP" - category="PERFORMANCE" /> - <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_LOCAL" - category="CORRECTNESS" /> - <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_FIELD" - category="CORRECTNESS" /> - <BugPattern abbrev="UVA" type="UVA_USE_VAR_ARGS" - category="STYLE" /> + <BugPattern abbrev="MRC" type="MRC_METHOD_RETURNS_CONSTANT" category="STYLE" /> + <BugPattern abbrev="NCS" type="NCS_NEEDLESS_CUSTOM_SERIALIZATION" category="CORRECTNESS" /> + <BugPattern abbrev="MOM" type="MOM_MISLEADING_OVERLOAD_MODEL" category="STYLE" /> + <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_NO_CONSTRAINTS" category="STYLE" /> + <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_HAS_CHECKED" category="STYLE" /> + <BugPattern abbrev="EXS" type="EXS_EXCEPTION_SOFTENING_NO_CHECKED" category="STYLE" /> + <BugPattern abbrev="CFS" type="CFS_CONFUSING_FUNCTION_SEMANTICS" category="STYLE" /> + <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_ACTUAL_CONSTANT" category="STYLE" /> + <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_INEXACT_DOUBLE" category="STYLE" /> + <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_BOOLEAN_ASSERT" category="STYLE" /> + <BugPattern abbrev="JAO" type="JAO_JUNIT_ASSERTION_ODDITIES_IMPOSSIBLE_NULL" category="CORRECTNESS" /> + <BugPattern abbrev="SCA" type="SCA_SUSPICIOUS_CLONE_ALGORITHM" category="CORRECTNESS" /> + <BugPattern abbrev="WEM" type="WEM_WEAK_EXCEPTION_MESSAGING" category="STYLE" /> + <BugPattern abbrev="SCSS" type="SCSS_SUSPICIOUS_CLUSTERED_SESSION_SUPPORT" category="CORRECTNESS" /> + <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_CLASS" category="CORRECTNESS" /> + <BugPattern abbrev="LO" type="LO_SUSPECT_LOG_PARAMETER" category="CORRECTNESS" /> + <BugPattern abbrev="IICU" type="IICU_INCORRECT_INTERNAL_CLASS_USE" category="CORRECTNESS" /> + <BugPattern abbrev="DSOC" type="DSOC_DUBIOUS_SET_OF_COLLECTIONS" category="PERFORMANCE" /> + <BugPattern abbrev="BED" type="BED_BOGUS_EXCEPTION_DECLARATION" category="CORRECTNESS" /> + <BugPattern abbrev="UNNC" type="UNNC_UNNECESSARY_NEW_NULL_CHECK" category="CORRECTNESS" /> + <BugPattern abbrev="DTEP" type="DTEP_DEPRECATED_TYPESAFE_ENUM_PATTERN" category="STYLE" /> + <BugPattern abbrev="SMA" type="SMA_STUTTERED_METHOD_ARGUMENTS" category="STYLE" /> + <BugPattern abbrev="TBP" type="TBP_TRISTATE_BOOLEAN_PATTERN" category="STYLE" /> + <BugPattern abbrev="SUA" type="SUA_SUSPICIOUS_UNINITIALIZED_ARRAY" category="CORRECTNESS" /> + <BugPattern abbrev="ITU" type="ITU_INAPPROPRIATE_TOSTRING_USE" category="CORRECTNESS" /> + <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_ATTRIBUTE_CASING" category="STYLE" /> + <BugPattern abbrev="IKNC" type="IKNC_INCONSISTENT_HTTP_PARAM_CASING" category="STYLE" /> + <BugPattern abbrev="OC" type="OC_OVERZEALOUS_CASTING" category="CORRECTNESS" /> + <BugPattern abbrev="PDP" type="PDP_POORLY_DEFINED_PARAMETER" category="CORRECTNESS" /> + <BugPattern abbrev="NSE" type="NSE_NON_SYMMETRIC_EQUALS" category="CORRECTNESS" /> + <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ARRAY_ASSIGNMENT" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="CVAA" type="CVAA_CONTRAVARIANT_ELEMENT_ASSIGNMENT" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="NFF" type="NFF_NON_FUNCTIONAL_FIELD" category="CORRECTNESS" /> + <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_FIELD_GUARD" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="SNG" type="SNG_SUSPICIOUS_NULL_LOCAL_GUARD" category="CORRECTNESS" experimental="true" /> + <BugPattern abbrev="MDM" type="MDM_RUNTIME_EXIT_OR_HALT" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_RUNFINALIZATION" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_INETADDRESS_GETLOCALHOST" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_PROMISCUOUS_SERVERSOCKET" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_THREAD_PRIORITIES" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_THREAD_YIELD" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_WAIT_WITHOUT_TIMEOUT" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_SIGNAL_NOT_SIGNALALL" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_THREAD_FAIRNESS" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_LOCK_ISLOCKED" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_STRING_BYTES_ENCODING" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_SETDEFAULTLOCALE" category="MT_CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_BIGDECIMAL_EQUALS" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_RANDOM_SEED" category="CORRECTNESS" /> + <BugPattern abbrev="MDM" type="MDM_SECURERANDOM" category="CORRECTNESS" /> + <BugPattern abbrev="ROOM" type="ROOM_REFLECTION_ON_OBJECT_METHODS" category="CORRECTNESS" /> + <BugPattern abbrev="IPU" type="IPU_IMPROPER_PROPERTIES_USE" category="CORRECTNESS" /> + <BugPattern abbrev="IPU" type="IPU_IMPROPER_PROPERTIES_USE_SETPROPERTY" category="CORRECTNESS" /> + <BugPattern abbrev="PCAIL" type="PCAIL_POSSIBLE_CONSTANT_ALLOCATION_IN_LOOP" category="PERFORMANCE" /> + <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_LOCAL" category="CORRECTNESS" /> + <BugPattern abbrev="WOC" type="WOC_WRITE_ONLY_COLLECTION_FIELD" category="CORRECTNESS" /> + <BugPattern abbrev="UVA" type="UVA_USE_VAR_ARGS" category="STYLE" /> + <BugPattern abbrev="PUS" type="PUS_POSSIBLE_UNSUSPECTED_SERIALIZATION" category="CORRECTNESS" /> </FindbugsPlugin> \ No newline at end of file Modified: trunk/fb-contrib/etc/messages.xml =================================================================== --- trunk/fb-contrib/etc/messages.xml 2010-08-22 04:43:28 UTC (rev 1590) +++ trunk/fb-contrib/etc/messages.xml 2010-08-28 01:33:41 UTC (rev 1591) @@ -1,31 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?> -<MessageCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="messagecollection.xsd"> - +<MessageCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="messagecollection.xsd"> + <Plugin> - <ShortDescription>fb-contrib plugin</ShortDescription> - <Details> + <ShortDescription>fb-contrib plugin</ShortDescription> + <Details> <![CDATA[ <p> This plugin contains FindBugs detectors from the fb-contrib project </p> ]]> </Details> - </Plugin> - + </Plugin> + <!-- Detectors --> - <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics"> - <Details> + <Detector class="com.mebigfatguy.fbcontrib.collect.CollectStatistics"> + <Details> <![CDATA[ <p>Collects statistics for other detectors</p> ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.InefficientStringBuffering"> - <Details> + <Details> <![CDATA[ <p> Looks for appending strings inside of calls to StringBuffer or StringBuilder append.</p> <p> <pre> @@ -37,9 +36,9 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.SyncCollectionIterators"> - <Details> + <Details> <![CDATA[ <p> Looks for use of iterators on synchronized collections built from the Collections class</p> <p> As the collection in question was built thru Collections.synchronizedXXX, an assumption @@ -49,9 +48,9 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.CyclomaticComplexity"> - <Details> + <Details> <![CDATA[ <p> Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an excessive value. This report value can be set with system property 'fb-contrib.cc.limit'.</p> @@ -59,9 +58,9 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.OverlyConcreteParameter"> - <Details> + <Details> <![CDATA[ <p> Looks for parameters that are defined by classes, but only use methods defined by an implemented interface or super class. Relying on concrete classes in public signatures causes cohesion, @@ -70,7 +69,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.ListIndexedIterating"> <Details> <![CDATA[ @@ -81,7 +80,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.UnrelatedCollectionContents"> <Details> <![CDATA[ @@ -95,7 +94,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.DeclaredRuntimeException"> <Details> <![CDATA[ @@ -107,7 +106,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy"> <Details> <![CDATA[ @@ -120,7 +119,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.LiteralStringComparison"> <Details> <![CDATA[ @@ -131,7 +130,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.PartiallyConstructedObjectAccess"> <Details> <![CDATA[ @@ -142,7 +141,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.DubiousListCollection"> <Details> <![CDATA[ @@ -153,7 +152,7 @@ ]]> </Details> </Detector> - + <Detector class="com.mebigfatguy.fbcontrib.detect.ParallelLists"> ... [truncated message content] |