From e46c3b1ca566b15d4df793026e55893a73c417d2 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Thu, 3 Feb 2011 17:54:47 +0100 Subject: [PATCH] SONAR-2166 Cardinality of checkstyle rule Member Name should be updated to multiple + replace the deprecated attribute 'priority' by a node --- .../org/sonar/plugins/checkstyle/rules.xml | 370 ++++-- .../org/sonar/plugins/findbugs/rules.xml | 1158 +++++++++++------ .../resources/org/sonar/plugins/pmd/rules.xml | 678 ++++++---- 3 files changed, 1471 insertions(+), 735 deletions(-) diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml index 6db38481782..74bdfd05e83 100644 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml +++ b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml @@ -1,7 +1,8 @@ - + +MAJOR @@ -23,7 +24,8 @@ - + +MAJOR @@ -65,7 +67,8 @@ - + +MAJOR @@ -81,7 +84,8 @@ - + +MAJOR @@ -89,7 +93,8 @@ - + +MAJOR @@ -101,7 +106,8 @@ - + +MINOR @@ -110,7 +116,8 @@

The JLS does not enforce the placement of package annotations. This placement may vary based on implementation. The JLS does highly recommend that all package annotations are placed in the package-info.java file. See Java Language specification, sections 7.4.1.1.

]]>
- + +MAJOR @@ -128,7 +135,8 @@ For example: @SupressWarnings((false) ? (true) ? "unchecked" : "foo" : "unused") - + +MAJOR @@ -161,7 +169,8 @@ should be refactored to: - + +MAJOR @@ -207,14 +216,16 @@ should be refactored to: - + +MAJOR Verifies there are no finalize() methods defined in a class.

]]>
- + +MINOR @@ -227,7 +238,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MINOR @@ -238,7 +250,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MAJOR @@ -261,7 +274,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MAJOR @@ -284,7 +298,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MAJOR @@ -310,7 +325,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MINOR @@ -320,7 +336,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MINOR @@ -334,7 +351,8 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + +MINOR @@ -359,7 +377,8 @@ But the following example is not: - + +MAJOR @@ -383,7 +402,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -395,7 +415,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain ]]> - + +MAJOR @@ -406,7 +427,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -415,13 +437,15 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MINOR @@ -432,13 +456,15 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR - + +MAJOR @@ -447,7 +473,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -457,7 +484,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -471,7 +499,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -481,7 +510,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -490,7 +520,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -501,14 +532,16 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +CRITICAL - + +MAJOR @@ -518,33 +551,38 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +INFO
  • Class (static) variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Instance variables. First the public class variables, then the protected, then package level (no access modifier), and then the private.
  • Constructors
  • Methods
  • ]]>
    - + +MAJOR - + +MINOR - + +MAJOR - + +MAJOR @@ -557,7 +595,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -567,7 +606,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -577,19 +617,22 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR - + +CRITICAL - + +MAJOR @@ -603,14 +646,16 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR @@ -625,7 +670,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -635,13 +681,15 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MINOR @@ -651,7 +699,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -661,7 +710,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -687,14 +737,16 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR @@ -704,7 +756,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -713,7 +766,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -723,7 +777,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -733,7 +788,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -743,7 +799,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -763,7 +820,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -786,7 +844,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -819,7 +878,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -835,7 +895,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -846,7 +907,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -858,7 +920,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -922,7 +985,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -965,7 +1029,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -993,7 +1058,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1005,7 +1071,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1024,7 +1091,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1041,7 +1109,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1052,7 +1121,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1067,7 +1137,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1079,7 +1150,9 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR + MULTIPLE @@ -1102,7 +1175,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1118,7 +1192,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1128,7 +1203,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1145,34 +1221,39 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR - + +MAJOR - + +MINOR - + +MAJOR MULTIPLE @@ -1191,14 +1272,16 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR @@ -1209,7 +1292,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1220,7 +1304,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1229,7 +1314,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1238,7 +1324,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1247,7 +1334,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1262,7 +1350,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1276,7 +1365,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1289,7 +1379,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1304,14 +1395,16 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR @@ -1322,13 +1415,15 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR @@ -1339,7 +1434,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1353,7 +1449,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1366,7 +1463,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1375,7 +1473,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1390,7 +1489,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1421,7 +1521,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1434,7 +1535,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1446,7 +1548,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1460,19 +1563,22 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR - + +MAJOR @@ -1482,7 +1588,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1495,25 +1602,29 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -1522,7 +1633,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1532,7 +1644,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1549,7 +1662,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1575,7 +1690,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1589,7 +1705,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MAJOR @@ -1600,26 +1717,30 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR - + +INFO - + +MINOR Section 3.10.1.]]> - + +MAJOR @@ -1636,7 +1757,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1646,7 +1768,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR @@ -1664,7 +1787,8 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + +MINOR diff --git a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml index cb1c9949065..bcd34822b75 100644 --- a/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml +++ b/plugins/sonar-findbugs-plugin/src/main/resources/org/sonar/plugins/findbugs/rules.xml @@ -1,13 +1,15 @@ - + +BLOCKER - + +BLOCKER @@ -21,21 +23,24 @@

    The correct way to do get an array of a specific type from a collection is to use c.toArray(new String[]); or c.toArray(new String[c.size()]); (the latter is slightly more efficient).

    There is one common/known exception exception to this. The toArray() method of lists returned by Arrays.asList(...) will return a covariantly typed array. For example, Arrays.asArray(new String[] { "a" }).toArray() will return a String []. FindBugs attempts to detect and suppress such cases, but may miss some.

    ]]>
    - + +BLOCKER - + +BLOCKER - + +MAJOR @@ -58,7 +63,8 @@ ]]> - + +BLOCKER @@ -66,7 +72,8 @@ - + +MAJOR @@ -74,7 +81,8 @@ - + +MAJOR @@ -82,7 +90,8 @@ - + +MAJOR @@ -90,7 +99,8 @@ - + +MAJOR @@ -98,7 +108,8 @@ - + +MAJOR @@ -124,7 +135,8 @@

    When a B is constructed, the constructor for the A class is invoked before the constructor for B sets value. Thus, when the constructor for A invokes getValue, an uninitialized value is read for value.

    ]]>
    - + +MAJOR @@ -134,32 +146,37 @@ - + +MINOR This field is never initialized within any constructor, and is therefore could be null after the object is constructed. This could be a either an error or a questionable design, since it means a null pointer exception will be generated if that field is dereferenced before being initialized.

    ]]>
    - + +MAJOR The program is dereferencing a field that does not seem to ever have a non-null value written to it. Dereferencing this value will generate a null pointer exception.

    ]]>
    - + +MINOR This field is never written. All reads of it will return the default value. Check for errors (should it have been initialized?), or remove it if it is useless.

    ]]>
    - + +MINOR This class is bigger than can be effectively handled, and was not fully analyzed for errors.

    ]]>
    - + +MINOR @@ -167,7 +184,8 @@ A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored.

    ]]>
    - + +MINOR @@ -175,21 +193,24 @@ A ScheduledThreadPoolExecutor with zero core threads will never execute anything While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the inherited tuning methods are not useful for it. In particular, because it acts as a fixed-sized pool using corePoolSize threads and an unbounded queue, adjustments to maximumPoolSize have no useful effect.

    ]]>
    - + +MAJOR All targets of this method invocation throw an UnsupportedOperationException.

    ]]>
    - + +CRITICAL This code creates a database connect using a blank or empty password. This indicates that the database is not protected by a password.

    ]]>
    - + +BLOCKER @@ -197,7 +218,8 @@ While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the easily learn the password.

    ]]>
    - + +MAJOR @@ -210,7 +232,8 @@ vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP re consider using a commercial static analysis or pen-testing tool.

    ]]>
    - + +MAJOR @@ -223,7 +246,8 @@ vulnerabilities that FindBugs doesn't report. If you are concerned about HTTP re consider using a commercial static analysis or pen-testing tool.

    ]]>
    - + +CRITICAL @@ -236,7 +260,8 @@ vulnerabilities that FindBugs doesn't report. If you are concerned about cross s consider using a commercial static analysis or pen-testing tool.

    ]]>
    - + +CRITICAL @@ -250,7 +275,8 @@ vulnerabilities that FindBugs doesn't report. If you are concerned about cross s consider using a commercial static analysis or pen-testing tool.

    ]]>
    - + +CRITICAL @@ -263,7 +289,8 @@ vulnerabilities that FindBugs doesn't report. If you are concerned about cross s consider using a commercial static analysis or pen-testing tool.

    ]]>
    - + +MAJOR @@ -277,21 +304,24 @@ could result in deadlocks or other related threading issues. A pack call causes components to be realized. As they are being realized (that is, not necessarily visible), they could trigger listener notification on the event dispatch thread.

    ]]>
    - + +CRITICAL This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception).

    ]]>
    - + +CRITICAL This method unconditionally invokes itself. This would seem to indicate an infinite recursive loop that will result in a stack overflow.

    ]]>
    - + +CRITICAL @@ -299,7 +329,8 @@ an infinite recursive loop that will result in a stack overflow.

    ]]>]]>
    - + +MAJOR @@ -311,7 +342,8 @@ are non-volatile. To get volatile array elements, you will need to use one of the atomic array classes in java.util.concurrent (provided in Java 5.0).

    ]]>
    - + +MAJOR @@ -319,7 +351,8 @@ in Java 5.0).

    ]]> results other than expected if this class is extended by a class in another package.

    ]]>
    - + +MAJOR @@ -330,7 +363,8 @@ another package.

    ]]> this will result in a NullPointerException.

    ]]>
    - + +MAJOR @@ -339,7 +373,8 @@ If it is null and then synchronized on a NullPointerException will be thrown and the check would be pointless. Better to synchronize on another field.

    ]]>
    - + +MAJOR @@ -348,7 +383,8 @@ another field.

    ]]> (e.g., x == 0 || y == 0).

    ]]>
    - + +MAJOR @@ -359,7 +395,8 @@ should be written to the ZipFile between the calls to putNextEntry() and closeEntry().

    ]]>
    - + +MAJOR @@ -370,7 +407,8 @@ should be written to the JarFile between the calls to putNextEntry() and closeEntry().

    ]]>
    - + +MAJOR @@ -378,7 +416,8 @@ should be written to the JarFile between the calls to thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on).

    ]]>
    - + +CRITICAL @@ -387,7 +426,8 @@ should be written to the JarFile between the calls to Floating point precision is very imprecise. For example, 16777216.0f + 1.0f = 16777216.0f. Consider using double math instead.

    ]]>
    - + +MAJOR @@ -395,7 +435,8 @@ should be written to the JarFile between the calls to Class implements Cloneable but does not define or use the clone method.

    ]]>
    - + +MAJOR @@ -404,7 +445,8 @@ There are some situations in which this is OK (e.g., you want to control how sub can clone themselves), but just make sure that this is what you intended.

    ]]>
    - + +MAJOR @@ -417,14 +459,16 @@ which violates the standard contract for clone().

    If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.

    ]]>
    - + +MAJOR The identifier is a word that is reserved as a keyword in later versions of Java, and your code will need to be changed in order to compile it in later versions of Java.

    ]]>
    - + +MAJOR @@ -432,7 +476,8 @@ in order to compile it in later versions of Java.

    ]]> any code that references this API, will need to be changed in order to compile it in later versions of Java.

    ]]>
    - + +MAJOR @@ -440,7 +485,8 @@ will need to be changed in order to compile it in later versions of Java.

    ]]> should be handled or reported in some way, or they should be thrown out of the method.

    ]]>
    - + +MAJOR @@ -448,7 +494,8 @@ will need to be changed in order to compile it in later versions of Java.

    ]]> should be handled or reported in some way, or they should be thrown out of the method.

    ]]>
    - + +MAJOR @@ -456,7 +503,8 @@ will need to be changed in order to compile it in later versions of Java.

    ]]> If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the invocation needs to occur inside a doPrivileged block.

    ]]>
    - + +MAJOR @@ -464,7 +512,8 @@ will need to be changed in order to compile it in later versions of Java.

    ]]> If this code will be granted security permissions, but might be invoked by code that does not have security permissions, then the classloader creation needs to occur inside a doPrivileged block.

    ]]>
    - + +MINOR @@ -472,7 +521,8 @@ will need to be changed in order to compile it in later versions of Java.

    ]]> that all fields are final. .

    ]]>
    - + +MAJOR @@ -481,7 +531,8 @@ a Runnable is expected. This is rather unusual, and may indicate a logic error or cause unexpected behavior.

    ]]>
    - + +BLOCKER @@ -491,7 +542,8 @@ See + +BLOCKER @@ -501,7 +553,8 @@ See + +MAJOR @@ -510,7 +563,8 @@ Consider using java.net.URI instead. (e.g., by using the isAnnotationPresent method). .

    ]]>
    - + +MAJOR @@ -519,7 +573,8 @@ Consider using java.net.URI instead. hard or impossible for your code to be invoked by other code. Consider throwing a RuntimeException instead.

    ]]>
    - + +MAJOR @@ -527,7 +582,8 @@ Consider using java.net.URI instead. or Runtime.runFinalizersOnExit for any reason: they are among the most dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>
    - + +MAJOR @@ -536,7 +592,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>String passed as a parameter.  Just use the argument String directly.

    ]]>
    - + +MAJOR @@ -547,14 +604,16 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>String object.  Therefore, you should just use the empty string constant directly.

    ]]>
    - + +INFO Calling String.toString() is just a redundant operation. Just use the String.

    ]]>
    - + +MAJOR @@ -566,7 +625,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>]]>
    - + +MAJOR @@ -576,7 +636,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>Boolean.valueOf() method (or Java 1.5 autoboxing) to create Boolean objects instead.

    ]]>
    - + +CRITICAL @@ -596,7 +657,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>Long, Integer, Short, Character, and Byte.

    ]]>
    - + +MAJOR @@ -611,7 +673,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>valueOf() method when creating instances of Double and Float.

    ]]>
    - + +INFO @@ -620,7 +683,8 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>String.toUpperCase( Locale l )String.toLowerCase( Locale l )

    versions instead.

    ]]>
    - + +MAJOR @@ -633,7 +697,8 @@ and e2 is of type Float, then e1 is unbox converted to a floating point value, and boxed. See JLS Section 15.25.

    ]]>
    - + +MAJOR @@ -642,14 +707,16 @@ converted to a floating point value, and boxed. See JLS Section 15.25. to immediately undo the work of the boxing.

    ]]>
    - + +MAJOR A primitive boxed value constructed and then immediately converted into a different primitive type (e.g., new Double(d).intValue()). Just perform direct primitive coercion (e.g., (int) d).

    ]]>
    - + +MAJOR @@ -666,14 +733,16 @@ to immediately undo the work of the boxing. new Boolean(true).toString()Boolean.toString(true) ]]> - + +MAJOR This method allocates an object just to call getClass() on it, in order to retrieve the Class object for it. It is simpler to just access the .class property of the class.

    ]]>
    - + +MAJOR @@ -684,7 +753,8 @@ to immediately undo the work of the boxing. methods defined by the Condition interface.

    ]]>
    - + +MAJOR @@ -692,7 +762,8 @@ to immediately undo the work of the boxing. want to multiple the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method.

    ]]>
    - + +MAJOR @@ -701,7 +772,8 @@ want to multiple the random value by something else before coercing it to an int using r.nextInt(n), rather than using (int)(r.nextDouble() * n).

    ]]>
    - + +CRITICAL @@ -711,7 +783,8 @@ a prepared statement instead. It is more efficient and less vulnerable to SQL injection attacks.

    ]]>
    - + +CRITICAL @@ -720,7 +793,8 @@ If unchecked, tainted data from a user is used in building this String, SQL inje be used to make the prepared statement do something unexpected and undesirable.

    ]]>
    - + +MAJOR @@ -728,7 +802,8 @@ be used to make the prepared statement do something unexpected and undesirable. by passing a Runnable object. This thread, then, does nothing but waste time.

    ]]>
    - + +MAJOR @@ -738,14 +813,16 @@ be used to make the prepared statement do something unexpected and undesirable.
    http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html.

    ]]>
    - + +MAJOR This finalizer nulls out fields. This is usually an error, as it does not aid garbage collection, and the object is going to be garbage collected anyway.]]> - + +MAJOR @@ -753,21 +830,24 @@ be used to make the prepared statement do something unexpected and undesirable. the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method.]]> - + +MAJOR A class's finalize() method should have protected access, not public.

    ]]>
    - + +MAJOR Empty finalize() methods are useless, so they should be deleted.

    ]]>
    - + +CRITICAL @@ -776,7 +856,8 @@ method.]]> actions defined for the superclass will not be performed.  Unless this is intended, delete this method.

    ]]>
    - + +MINOR @@ -784,7 +865,8 @@ method.]]> the superclass's finalize() method, making it redundant.  Delete it.

    ]]>
    - + +MAJOR @@ -793,7 +875,8 @@ method.]]> actions defined for the superclass will not be performed.  Add a call to super.finalize().

    ]]>
    - + +MAJOR @@ -805,7 +888,8 @@ finalize method on all the finalizable object, possibly at the same time in diff Thus, it is a particularly bad idea, in the finalize method for a class X, invoke finalize on objects referenced by X, because they may already be getting finalized in a separate thread.]]> - + +MAJOR @@ -827,7 +911,8 @@ public boolean equals(Object o) { is symmetric and transitive. Without those properties, very unexpected behavoirs are possible.

    ]]>
    - + +MAJOR @@ -839,7 +924,8 @@ the covariant enum method, and as not equal when compared normally. Don't do it.

    ]]>
    - + +MAJOR @@ -849,7 +935,8 @@ Don't do it. The class should probably define a boolean equals(Object) method.

    ]]>
    - + +MAJOR @@ -859,7 +946,8 @@ Don't do it. The class should probably define a boolean equals(Object) method.

    ]]>
    - + +MAJOR @@ -885,7 +973,8 @@ that the equals method for the subclass just return the result of invoking super.equals(o).

    ]]>
    - + +MAJOR @@ -894,7 +983,8 @@ invoking super.equals(o). java.lang.Object, the parameter of equals() must have type java.lang.Object.

    ]]>
    - + +MAJOR @@ -906,7 +996,8 @@ checks that the argument is an instanceof B, it is quite likely that the equival methods is not symmetric.

    ]]>
    - + +CRITICAL @@ -916,7 +1007,8 @@ it might check if Foo.class == o.getClass()). It is better to check if this.getClass() == o.getClass().

    ]]>
    - + +MINOR @@ -925,7 +1017,8 @@ is compatible with the type of the this object. There might not be this code, but it is worth reviewing.

    ]]>
    - + +MAJOR @@ -934,7 +1027,8 @@ of their classes are equal. You can have different classes with the same name if different class loaders. Just check to see if the class objects are the same.

    ]]>
    - + +BLOCKER @@ -942,7 +1036,8 @@ different class loaders. Just check to see if the class objects are the same. Plus, it means that the equals method is not symmetric.

    ]]>
    - + +BLOCKER @@ -955,7 +1050,8 @@ public boolean equals(Object o) { return this == o; }

    ]]>
    - + +CRITICAL @@ -968,7 +1064,8 @@ that classfile. See + +MAJOR @@ -978,7 +1075,8 @@ that classfile. See + +CRITICAL @@ -989,7 +1087,8 @@ that classfile. See + +MAJOR @@ -998,7 +1097,8 @@ that classfile. See + +CRITICAL @@ -1009,7 +1109,8 @@ from Object is unhashable, since it doesn't fulfill the requirement that equal objects have equal hashCodes.

    ]]>
    - + +CRITICAL @@ -1018,7 +1119,8 @@ and thus doesn't fulfill the requirement that equal objects have equal hashCodes An instance of this class is used in a hash data structure, making the need to fix this problem of highest importance.]]> - + +CRITICAL @@ -1037,7 +1139,8 @@ the recommended hashCode implementation to use is:

    return 42; // any arbitrary constant will do }

    ]]>
    - + +CRITICAL @@ -1057,7 +1160,8 @@ should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals." ]]> - + +CRITICAL @@ -1065,7 +1169,8 @@ is "Note: this class has a natural ordering that is inconsistent with equals." equals() method.  Therefore, the class may violate the invariant that equal objects must have equal hashcodes.

    ]]>
    - + +CRITICAL @@ -1083,7 +1188,8 @@ the recommended hashCode implementation to use is:

    return 42; // any arbitrary constant will do }]]>
    - + +CRITICAL @@ -1099,7 +1205,8 @@ the recommended hashCode implementation to use is:

    define the hashCode() method to throw UnsupportedOperationException.

    ]]>
    - + +MAJOR @@ -1107,7 +1214,8 @@ the recommended hashCode implementation to use is:

    override hashCode().  Therefore, the class may violate the invariant that equal objects must have equal hashcodes.

    ]]>
    - + +MAJOR @@ -1116,7 +1224,8 @@ the recommended hashCode implementation to use is:

    java.lang.Object, the parameter of equals() must have type java.lang.Object.

    ]]>
    - + +MAJOR @@ -1127,7 +1236,8 @@ interned using the String.intern() method, the same string value may be represented by two different String objects. Consider using the equals(Object) method instead.

    ]]>
    - + +MAJOR @@ -1137,7 +1247,8 @@ pass only String constants or interned strings to a method is unnecessarily fragile, and rarely leads to measurable performance gains. Consider using the equals(Object) method instead.

    ]]>
    - + +MAJOR @@ -1146,14 +1257,16 @@ using the equals(Object) method instead.

    ]]> Comparable interface, the parameter of compareTo() must have type java.lang.Object.

    ]]>
    - + +CRITICAL This field is annotated with net.jcip.annotations.GuardedBy, but can be accessed in a way that seems to violate the annotation.

    ]]>
    - + +MAJOR @@ -1164,7 +1277,8 @@ have multiple threads invoke methods on that instance to service multiple simultaneous requests. Thus, having a mutable instance field generally creates race conditions.]]> - + +CRITICAL @@ -1192,7 +1306,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +CRITICAL @@ -1207,7 +1322,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +CRITICAL @@ -1218,7 +1334,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +MAJOR @@ -1231,7 +1348,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +MAJOR @@ -1244,7 +1362,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +MAJOR @@ -1256,7 +1375,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +MAJOR @@ -1265,7 +1385,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>run() method invoked in a new thread, in which case Thread.start() is the right method to call.

    ]]>
    - + +MAJOR @@ -1274,7 +1395,8 @@ Thus, having a mutable instance field generally creates race conditions.]]>]]> - + +CRITICAL @@ -1297,7 +1419,8 @@ Language Specification
    for details

    ]]>
    - + +MAJOR @@ -1315,7 +1438,8 @@ Language Specification for details

    ]]>
    - + +MAJOR @@ -1328,7 +1452,8 @@ Language Specification for details This not necessarily a bug, but is worth examining closely.

    ]]>
    - + +MAJOR @@ -1338,7 +1463,8 @@ This not necessarily a bug, but is worth examining before calling wait; any previous notifications will be ignored.

    ]]>
    - + +MAJOR @@ -1346,7 +1472,8 @@ This not necessarily a bug, but is worth examining This is often caused when the programmer mistakenly uses the field instead of one of the constructor's parameters.

    ]]>
    - + +MAJOR @@ -1356,7 +1483,8 @@ This not necessarily a bug, but is worth examining method will not necessarily see a consistent state for the object.  The get method should be made synchronized.

    ]]>
    - + +CRITICAL @@ -1364,7 +1492,8 @@ This not necessarily a bug, but is worth examining classes referenced by the bug instance.  Many kinds of unexpected behavior may arise from such circularity.

    ]]>
    - + +MAJOR @@ -1382,7 +1511,8 @@ public class CircularClassInitialization { } ]]> - + +MINOR @@ -1392,7 +1522,8 @@ public class CircularClassInitialization { method should be changed so it throws NoSuchElementException if is called when there are no more elements to return.

    ]]>
    - + +CRITICAL @@ -1409,7 +1540,8 @@ is locking on something that other code might also be locking. This could result blocking and deadlock behavior. See http://www.javalobby.org/java/forums/t96352.html and http://jira.codehaus.org/browse/JETTY-352.

    ]]>
    - + +CRITICAL @@ -1429,7 +1561,8 @@ private static Boolean inited = Boolean.FALSE;

    Since there normally exist only two Boolean objects, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock

    ]]>
    - + +CRITICAL @@ -1454,7 +1587,8 @@ might replace this with the use of an interned Integer object shared throughout the JVM, leading to very confusing behavior and potential deadlock.

    ]]>
    - + +CRITICAL @@ -1472,7 +1606,8 @@ private static Integer count = 0; this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock

    ]]>
    - + +MAJOR @@ -1486,7 +1621,8 @@ are almost never a better solution than less contrived solutions.

    ]]>
    - + +MAJOR @@ -1510,7 +1646,8 @@ than less contrived solutions. distinguishing locked vs. unlocked accesses, the code in question may still be correct.

    ]]>
    - + +MAJOR @@ -1536,7 +1673,8 @@ private Long getNotificationSequenceNumber() {

    ]]>
    - + +MAJOR @@ -1545,7 +1683,8 @@ private Long getNotificationSequenceNumber() { This is unlikely to have useful semantics, since different threads may be synchronizing on different objects.

    ]]>
    - + +MAJOR @@ -1562,7 +1701,8 @@ defined in an interface references a mutable to avoid this vulnerability.

    ]]>
    - + +MAJOR @@ -1573,7 +1713,8 @@ defined in an interface references a mutable to avoid this vulnerability.

    ]]>
    - + +MAJOR @@ -1583,7 +1724,8 @@ defined in an interface references a mutable The field could be made final to avoid this vulnerability.

    ]]>
    - + +MAJOR @@ -1592,7 +1734,8 @@ defined in an interface references a mutable The field could be made package protected to avoid this vulnerability.

    ]]>
    - + +MAJOR @@ -1601,7 +1744,8 @@ defined in an interface references a mutable by accident from another package. This code can freely modify the contents of the Hashtable.

    ]]>
    - + +MAJOR @@ -1610,7 +1754,8 @@ defined in an interface references a mutable by accident from another package. This code can freely modify the contents of the array.

    ]]>
    - + +MAJOR @@ -1620,7 +1765,8 @@ defined in an interface references a mutable Unfortunately, the way the field is used doesn't allow any easy fix to this problem.

    ]]>
    - + +MAJOR @@ -1632,7 +1778,8 @@ thus it will be clear to other readers of your code and to FindBugs that you want to invoke the inherited method, not the method in the outer class.

    ]]>
    - + +MAJOR @@ -1643,7 +1790,8 @@ to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses.

    ]]>
    - + +MAJOR @@ -1654,7 +1802,8 @@ to resolve references and creates many opportunities to accidently define methods that do not override methods in their superclasses.

    ]]>
    - + +MAJOR @@ -1663,7 +1812,8 @@ This is very confusing because if the capitalization were identical then one of the methods would override the other.

    ]]>
    - + +MAJOR @@ -1674,7 +1824,8 @@ seems that the existence of both of these methods is intentional, but is sure is You should try hard to eliminate one of them, unless you are forced to have both due to frozen APIs.

    ]]>
    - + +MAJOR @@ -1702,7 +1853,8 @@ override the types are Foo's from different packages.

    ]]>
    - + +MAJOR @@ -1736,13 +1888,15 @@ so this is presumably understood. However, such methods are exceptionally confus removing or deprecating the method with the similar but not identical signature.

    ]]>
    - + +MAJOR The referenced methods have names that differ only by capitalization.

    ]]>
    - + +MAJOR @@ -1752,14 +1906,16 @@ removing or deprecating the method with the similar but not identical signature. but can't get rid of this method due to backwards compatibility, deprecate the method.

    ]]>
    - + +MAJOR This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class.

    ]]>
    - + +MAJOR @@ -1771,7 +1927,8 @@ be confusing to users of this class.

    ]]> reads from input streams usually do read the full amount of data requested, causing the program to fail only sporadically.

    ]]>
    - + +MAJOR @@ -1785,7 +1942,8 @@ be confusing to users of this class.

    ]]> skip() will only skip data in the buffer, and will routinely fail to skip the requested number of bytes.

    ]]>
    - + +MAJOR @@ -1793,7 +1951,8 @@ be confusing to users of this class.

    ]]> mechanism, it must not be declared as a static method.

    ]]>
    - + +MAJOR @@ -1801,7 +1960,8 @@ mechanism, it must not be declared as a static method. This might be intentional and OK, but should be reviewed to ensure it is what is intended.

    ]]>
    - + +MAJOR @@ -1809,7 +1969,8 @@ This might be intentional and OK, but should be reviewed to ensure it is what is mechanism, it must be declared to have a return type of Object.

    ]]>
    - + +MAJOR @@ -1819,7 +1980,8 @@ This may be leftover marking from a previous version of the code in which the cl it may indicate a misunderstanding of how serialization works.

    ]]>
    - + +MAJOR @@ -1827,7 +1989,8 @@ it may indicate a misunderstanding of how serialization works. deserialized instance of the class.

    ]]>
    - + +MAJOR @@ -1835,7 +1998,8 @@ deserialized instance of the class. for custom serialization/deserialization. But since that method isn't declared private, it will be silently ignored by the serialization/deserialization API.

    ]]>
    - + +MAJOR @@ -1845,7 +2009,8 @@ deserialized instance of the class. constructor. Since this class does not have one, serialization and deserialization will fail at runtime.

    ]]>
    - + +MAJOR @@ -1856,7 +2021,8 @@ deserialized instance of the class. Since the superclass does not have one, serialization and deserialization will fail at runtime.

    ]]>
    - + +MAJOR @@ -1873,7 +2039,8 @@ deserialized instance of the class. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID.

    ]]>
    - + +MAJOR @@ -1886,7 +2053,8 @@ As most comparators have little or no state, making them serializable is generally easy and good defensive programming.

    ]]>
    - + +CRITICAL @@ -1894,7 +2062,8 @@ is generally easy and good defensive programming. This class has a writeObject() method which is synchronized; however, no other method of the class is synchronized.

    ]]>
    - + +CRITICAL @@ -1905,7 +2074,8 @@ is generally easy and good defensive programming. method itself is causing the object to become visible to another thread, that is an example of very dubious coding style.

    ]]>
    - + +MAJOR @@ -1914,7 +2084,8 @@ is generally easy and good defensive programming. if it is intended to specify the version UID for purposes of serialization.

    ]]>
    - + +CRITICAL @@ -1923,7 +2094,8 @@ is generally easy and good defensive programming. if it is intended to specify the version UID for purposes of serialization.

    ]]>
    - + +MAJOR @@ -1932,7 +2104,8 @@ is generally easy and good defensive programming. if it is intended to specify the version UID for purposes of serialization.

    ]]>
    - + +MINOR @@ -1945,7 +2118,8 @@ problem. Making the outer class serializable might also work, but that would mean serializing an instance of the inner class would always also serialize the instance of the outer class, which it often not what you really want.]]> - + +MAJOR @@ -1955,14 +2129,16 @@ so this won't fail, but it might serialize a lot more data than intended. If possible, making the inner class a static inner class (also known as a nested class) should solve the problem.]]> - + +CRITICAL A non-serializable value is stored into a non-transient field of a serializable class.

    ]]>
    - + +CRITICAL @@ -1970,7 +2146,8 @@ of a serializable class.

    ]]> the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started.

    ]]>
    - + +MAJOR @@ -1978,19 +2155,22 @@ of a serializable class.

    ]]> is initialized to a compile-time static value. Consider making the field static.

    ]]>
    - + +MAJOR This field is never used.  Consider removing it from the class.

    ]]>
    - + +MAJOR This field is never read.  Consider removing it from the class.

    ]]>
    - + +CRITICAL @@ -1999,7 +2179,8 @@ of a serializable class.

    ]]> by the for loop.

    ]]>
    - + +CRITICAL @@ -2007,7 +2188,8 @@ of a serializable class.

    ]]> all reads of the field will return null. Check for errors, or remove it if it is useless.

    ]]>
    - + +CRITICAL @@ -2016,7 +2198,8 @@ correct if multiple instances are being manipulated, and generally bad practice.

    ]]>
    - + +CRITICAL @@ -2026,7 +2209,8 @@ intended to refer to a different variable, or perhaps the earlier check to see i variable is null should have been a check to see if it was nonnull).

    ]]>
    - + +CRITICAL @@ -2034,7 +2218,8 @@ variable is null should have been a check to see if it was nonnull). to read, readLine() will return null and dereferencing that will generate a null pointer exception.

    ]]>
    - + +CRITICAL @@ -2042,7 +2227,8 @@ to read, readLine() will return null and dereferencing that will generate a null to read, readLine() will return null and dereferencing that will generate a null pointer exception.

    ]]>
    - + +MAJOR @@ -2053,7 +2239,8 @@ to read, readLine() will return null and dereferencing that will generate a null made static.

    ]]>
    - + +MAJOR @@ -2065,7 +2252,8 @@ to read, readLine() will return null and dereferencing that will generate a null classes cannot be marked as static, doing this will require refactoring the inner class so that it is a named inner class.

    ]]>
    - + +MAJOR @@ -2080,7 +2268,8 @@ inner object.  This reference makes the instances pass a reference to the outer instance to the constructor for the inner class.

    ]]>
    - + +CRITICAL @@ -2089,7 +2278,8 @@ inner object.  This reference makes the instances the condition the caller intended to wait for might not be the one that actually occurred.

    ]]>
    - + +CRITICAL @@ -2099,7 +2289,8 @@ inner object.  This reference makes the instances the condition the caller intended to wait for might not be the one that actually occurred.

    ]]>
    - + +CRITICAL @@ -2108,7 +2299,8 @@ inner object.  This reference makes the instances only wakes up one thread, meaning that the thread woken up might not be the one waiting for the condition that the caller just satisfied.

    ]]>
    - + +MINOR @@ -2117,7 +2309,8 @@ inner object.  This reference makes the instances positive only if the substring checked for occurs at some place other than at the beginning of the String.

    ]]>
    - + +MAJOR @@ -2125,7 +2318,8 @@ inner object.  This reference makes the instances value is non-null. In almost all situations, if the result is non-null, you will want to use that non-null value. Calling readLine again will give you a different line.

    ]]>
    - + +MINOR @@ -2150,7 +2344,8 @@ dateString = dateString.trim(); ]]> - + +MAJOR @@ -2163,7 +2358,8 @@ If you don't check the result, you won't notice if the method invocation signals unexpected behavior by returning an atypical return value.

    ]]>
    - + +CRITICAL @@ -2183,7 +2379,8 @@ if (x < 0) ]]> - + +MAJOR @@ -2208,21 +2405,24 @@ dateString = dateString.trim(); ]]> - + +CRITICAL A null pointer is dereferenced here.  This will lead to a NullPointerException when the code is executed.

    ]]>
    - + +CRITICAL A value that could be null is stored into a field that has been annotated as NonNull.

    ]]>
    - + +CRITICAL @@ -2234,7 +2434,8 @@ this may be a false warning.

    Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

    ]]>
    - + +CRITICAL @@ -2243,7 +2444,8 @@ but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong.

    ]]>
    - + +CRITICAL @@ -2254,7 +2456,8 @@ Of course, the problem might be that the branch or statement is infeasible and t the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.

    ]]>
    - + +CRITICAL @@ -2266,7 +2469,8 @@ the null pointer exception can't ever be executed; deciding that is beyond the a Due to the fact that this value had been previously tested for nullness, this is a definite possibility.

    ]]>
    - + +CRITICAL @@ -2279,7 +2483,8 @@ this may be a false warning.

    Also note that FindBugs considers the default case of a switch statement to be an exception path, since the default case is often infeasible.

    ]]>
    - + +CRITICAL @@ -2288,7 +2493,8 @@ and the return value of that method is one that should generally be checked for null. This may lead to a NullPointerException when the code is executed.

    ]]>
    - + +CRITICAL @@ -2299,7 +2505,8 @@ for null. This may lead to a NullPointerException when the code is dereferenced.

    ]]>
    - + +CRITICAL @@ -2311,7 +2518,8 @@ for null. This may lead to a NullPointerException when the code is dereferenced.

    ]]>
    - + +CRITICAL @@ -2322,7 +2530,8 @@ for null. This may lead to a NullPointerException when the code is dereferenced.

    ]]>
    - + +CRITICAL @@ -2333,7 +2542,8 @@ for null. This may lead to a NullPointerException when the code is always dereferenced.

    ]]>
    - + +CRITICAL @@ -2342,7 +2552,8 @@ for null. This may lead to a NullPointerException when the code is which it overrides) is declared to return @NonNull.

    ]]>
    - + +CRITICAL @@ -2352,7 +2563,8 @@ for null. This may lead to a NullPointerException when the code is instead.

    ]]>
    - + +CRITICAL @@ -2362,7 +2574,8 @@ for null. This may lead to a NullPointerException when the code is other code to break. Return the empty string or some other appropriate string rather than null.

    ]]>
    - + +BLOCKER @@ -2373,7 +2586,8 @@ for null. This may lead to a NullPointerException when the code is (except on forward paths involving runtime exceptions).

    ]]>
    - + +CRITICAL @@ -2385,14 +2599,16 @@ for null. This may lead to a NullPointerException when the code is (except on forward paths involving runtime exceptions).

    ]]>
    - + +CRITICAL The class's static initializer creates an instance of the class before all of the static final fields are assigned.

    ]]>
    - + +CRITICAL @@ -2404,7 +2620,8 @@ a file descriptor leak.  It is generally a good idea to use a finally block to ensure that streams are closed.

    ]]>
    - + +CRITICAL @@ -2415,7 +2632,8 @@ This may result in a file descriptor leak.  It is generally a good idea to use a finally block to ensure that streams are closed.

    ]]>
    - + +MAJOR @@ -2430,7 +2648,8 @@ For example, File.listFiles() returns an empty list if given a directory containing no files, and returns null if the file is not a directory.

    ]]>
    - + +CRITICAL @@ -2445,7 +2664,8 @@ block for an if statement:

    } ]]>
    - + +CRITICAL @@ -2459,7 +2679,8 @@ body of an if statement, e.g.:

    System.out.println("Hello, " + argv[0]); ]]>
    - + +CRITICAL @@ -2470,35 +2691,40 @@ Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.

    ]]>
    - + +CRITICAL This method contains a redundant check of a known null value against the constant null.

    ]]>
    - + +CRITICAL This method contains a redundant check of a known non-null value against the constant null.

    ]]>
    - + +CRITICAL This method contains a redundant comparison of two references known to both be definitely null.

    ]]>
    - + +CRITICAL This method contains a reference known to be non-null with another reference known to be null.

    ]]>
    - + +CRITICAL @@ -2516,7 +2742,8 @@ for using a JSR-166 lock is: } ]]> - + +CRITICAL @@ -2534,7 +2761,8 @@ for using a JSR-166 lock is: } ]]> - + +CRITICAL @@ -2543,7 +2771,8 @@ where the correct way to compare instances of this type is generally with the equals() method. Examples of classes which should generally not be compared by reference are java.lang.Integer, java.lang.Float, etc.

    ]]>
    - + +CRITICAL @@ -2551,7 +2780,8 @@ not be compared by reference are java.lang.Integer, java.lang.Float, etc.

    ]]> different types. The result of this comparison will always be false at runtime.

    ]]>
    - + +CRITICAL @@ -2568,7 +2798,8 @@ contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime.

    ]]>
    - + +CRITICAL @@ -2586,7 +2817,8 @@ contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime.

    ]]>
    - + +CRITICAL @@ -2605,7 +2837,8 @@ contract defined by java.lang.Object.equals(Object), the result of this comparison will always be false at runtime.

    ]]>
    - + +CRITICAL @@ -2613,7 +2846,8 @@ the result of this comparison will always be false at runtime. the argument. According to the contract of the equals() method, this call should always return false.

    ]]>
    - + +CRITICAL @@ -2621,7 +2855,8 @@ this call should always return false.

    ]]> on the object.  Calling wait() without a lock held will result in an IllegalMonitorStateException being thrown.

    ]]>
    - + +CRITICAL @@ -2629,7 +2864,8 @@ an IllegalMonitorStateException being thrown.

    ]]> on the object.  Calling notify() or notifyAll() without a lock held will result in an IllegalMonitorStateException being thrown.

    ]]>
    - + +CRITICAL @@ -2644,7 +2880,8 @@ an IllegalMonitorStateException being thrown.

    ]]> Such assignments are useless, and may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2658,7 +2895,8 @@ Such assignments are useless, and may indicate a logic error or typo.

    Such assignments are useless, and may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2672,7 +2910,8 @@ Such assignments are useless, and may indicate a logic error or typo.

    Assigning to a field twice is useless, and may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2686,7 +2925,8 @@ Such assignments are useless, and may indicate a logic error or typo.

    Assigning the same value to a variable twice is useless, and may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2697,7 +2937,8 @@ and may indicate a typo or a logic error. Double check the computation.

    ]]>
    - + +CRITICAL @@ -2708,7 +2949,8 @@ and may indicate a typo or a logic error. Double check the computation.

    ]]>
    - + +CRITICAL @@ -2716,7 +2958,8 @@ a logic error. Double check the computation. a logic error. Make sure that you are comparing the right things.

    ]]>
    - + +CRITICAL @@ -2724,7 +2967,8 @@ a logic error. Make sure that you are comparing the right things. a logic error. Make sure that you are comparing the right things.

    ]]>
    - + +CRITICAL @@ -2733,7 +2977,8 @@ a logic error. Make sure that you are comparing the right things. to give the intended result.

    ]]>
    - + +CRITICAL @@ -2748,7 +2993,8 @@ number; the values are too easily guessable. You should strongly consider using (and avoid allocating a new SecureRandom for each random number needed).

    ]]>
    - + +CRITICAL @@ -2758,7 +3004,8 @@ generator is Integer.MIN_VALUE, then the result will be negative as Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE).

    ]]>
    - + +CRITICAL @@ -2768,7 +3015,8 @@ is Integer.MIN_VALUE, then the result will be negative as well (sin Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE).

    ]]>
    - + +CRITICAL @@ -2779,7 +3027,8 @@ can also be negative. Be sure this is intended, and strongly consider using the Random.nextInt(int) method instead.

    ]]>
    - + +CRITICAL @@ -2798,14 +3047,16 @@ value of the result of the remainder operation (i.e., use Math.abs(x.hashCode()%n)

    ]]>
    - + +CRITICAL This code compares a value that is guaranteed to be non-negative with a negative constant.

    ]]>
    - + +CRITICAL @@ -2815,7 +3066,8 @@ To convert a signed byte b to an unsigned value in the range 0..255 use 0xff & b

    ]]>
    - + +CRITICAL @@ -2824,7 +3076,8 @@ use 0xff & b

    ]]>
    - + +CRITICAL @@ -2832,7 +3085,8 @@ use 0xff & b the same value (e.g., x <= Integer.MAX_VALUE).

    ]]>
    - + +CRITICAL @@ -2840,7 +3094,8 @@ the same value (e.g., x <= Integer.MAX_VALUE). Did you mean (exp & 1) or (exp % 2) instead?

    ]]>
    - + +CRITICAL @@ -2868,7 +3123,8 @@ for(int i = 0; i < 4; i++) result = ((result << 8) | (b[i] & 0xff)); ]]> - + +CRITICAL @@ -2896,7 +3152,8 @@ for(int i = 0; i < 4; i++) result = ((result << 8) + (b[i] & 0xff)); ]]> - + +CRITICAL @@ -2905,7 +3162,8 @@ which will always compare unequal due to the specific values of constants C and D. This may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2921,7 +3179,8 @@ to use '!= 0' instead of '> 0'. Boris Bokowski

    ]]>
    - + +CRITICAL @@ -2937,7 +3196,8 @@ to use '!= 0' instead of '> 0'. Boris Bokowski

    ]]>
    - + +CRITICAL @@ -2945,7 +3205,8 @@ to use '!= 0' instead of '> 0'. which will always compare equal. This may indicate a logic error or typo.

    ]]>
    - + +CRITICAL @@ -2958,7 +3219,8 @@ This may indicate a logic error or typo.

    a membership test in a bit set, but uses the bitwise OR operator ("|") instead of bitwise AND ("&").

    ]]>
    - + +CRITICAL @@ -2971,7 +3233,8 @@ For more information, see the Java Memory Model web site.

    ]]>
    - + +CRITICAL @@ -2983,7 +3246,8 @@ you have a very serious multithreading bug, unless something else preve any other thread from accessing the stored object until it is fully initialized.

    ]]>
    - + +CRITICAL @@ -2992,7 +3256,8 @@ any other thread from accessing the stored object until it is fully initialized. the lock() and unlock() methods instead.

    ]]>
    - + +CRITICAL @@ -3002,7 +3267,8 @@ it is more likely that the method is never used, and should be removed.

    ]]>
    - + +CRITICAL @@ -3014,7 +3280,8 @@ override a method declared in a superclass, and due to an typo or other error th in fact, override the method it is intended to.

    ]]>
    - + +CRITICAL @@ -3027,7 +3294,8 @@ result in poor performance, and could cause the application to have problems communicating with the database.

    ]]>
    - + +CRITICAL @@ -3039,7 +3307,8 @@ close database resources on all paths out of a method may result in poor performance, and could cause the application to have problems communicating with the database.

    ]]>
    - + +CRITICAL @@ -3068,7 +3337,8 @@ a StringBuffer (or StringBuilder in Java 1.5) explicitly.

    String s = buf.toString(); ]]>
    - + +CRITICAL @@ -3080,7 +3350,8 @@ elements of the collection, then it is populated and returned directly. This avoids the need to create a second array (by reflection) to return as the result.

    ]]>
    - + +CRITICAL @@ -3091,28 +3362,32 @@ the test method, the exception will terminate the thread but not result in the test failing.

    ]]>
    - + +CRITICAL Class is a JUnit TestCase and implements the setUp method. The setUp method should call super.setUp(), but doesn't.

    ]]>
    - + +CRITICAL Class is a JUnit TestCase and implements the tearDown method. The tearDown method should call super.tearDown(), but doesn't.

    ]]>
    - + +CRITICAL Class is a JUnit TestCase and implements the suite() method. The suite method should be declared as being static, but isn't.

    ]]>
    - + +CRITICAL @@ -3123,13 +3398,15 @@ or
    public static junit.framework.TestSuite suite()

    ]]>
    - + +CRITICAL Class is a JUnit TestCase but has not implemented any test methods

    ]]>
    - + +CRITICAL @@ -3137,28 +3414,32 @@ or a listener defined in the java.awt.event or javax.swing.event package. As a result, this method will not get called when the event occurs.

    ]]>
    - + +CRITICAL A call to getXXX or updateXXX methods of a result set was made where the field index is 0. As ResultSet fields start at index 1, this is always a mistake.

    ]]>
    - + +CRITICAL A call to a setXXX method of a prepared statement was made where the parameter index is 0. As parameter indexes start at index 1, this is always a mistake.

    ]]>
    - + +CRITICAL Type check performed using the instanceof operator where it can be statically determined whether the object is of the type requested.

    ]]>
    - + +CRITICAL @@ -3171,7 +3452,8 @@ To compare the contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).

    ]]>
    - + +CRITICAL @@ -3181,7 +3463,8 @@ method of Object, calling equals on an array is the same as comparing their addr contents of the arrays, use java.util.Arrays.equals(Object[], Object[]).

    ]]>
    - + +CRITICAL @@ -3190,7 +3473,8 @@ This method invokes the Thread.currentThread() call, just to call the interrupte static method, is more simple and clear to use Thread.interrupted().

    ]]>
    - + +CRITICAL @@ -3200,7 +3484,8 @@ not the current thread. As the interrupted() method is static, the interrupted m object than the one the author intended.

    ]]>
    - + +CRITICAL @@ -3211,7 +3496,8 @@ the write to the parameter will be conveyed back to the caller.

    ]]>
    - + +CRITICAL @@ -3227,7 +3513,8 @@ final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

    ]]>
    - + +CRITICAL @@ -3236,7 +3523,8 @@ This statement assigns to a local variable in a return statement. This assignmen has effect. Please verify that this statement does the right thing.

    ]]>
    - + +CRITICAL @@ -3251,7 +3539,8 @@ In Java 5 and later, it does not. for more details and examples, and suggestions on how to force class initialization in Java 5.

    ]]>
    - + +CRITICAL @@ -3260,7 +3549,8 @@ read. This store may have been introduced to assist the garbage collector, but as of Java SE 6.0, this is no longer needed or useful.

    ]]>
    - + +MAJOR @@ -3269,7 +3559,8 @@ in this class or a superclass. This may cause the method to read an uninitialized value from the field, leave the field uninitialized, or both.

    ]]>
    - + +MAJOR @@ -3278,7 +3569,8 @@ instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of the fields when they wanted the other.

    ]]>
    - + +CRITICAL @@ -3286,14 +3578,16 @@ the fields when they wanted the other.

    ]]> a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.

    ]]>
    - + +MAJOR This class allocates an object that is based on a class that only supplies static methods. This object does not need to be created, just access the static methods directly using the class name as a qualifier.

    ]]>
    - + +MAJOR @@ -3305,7 +3599,8 @@ does not need to be created, just access the static methods directly using the c masking potential bugs.

    ]]>
    - + +CRITICAL @@ -3322,7 +3617,8 @@ does not need to be created, just access the static methods directly using the c x is floating point precision).

    ]]>
    - + +CRITICAL @@ -3338,7 +3634,8 @@ does not need to be created, just access the static methods directly using the c See the Java Language Specification, section 4.2.4.

    ]]>
    - + +CRITICAL @@ -3421,7 +3718,8 @@ just use the constant. Methods detected are: ]]> - + +MAJOR @@ -3433,7 +3731,8 @@ just use the constant. Methods detected are: the interface's implementation.

    ]]>
    - + +CRITICAL @@ -3445,7 +3744,8 @@ just use the constant. Methods detected are: are reported.

    ]]>
    - + +CRITICAL @@ -3456,7 +3756,8 @@ just use the constant. Methods detected are: only using method local variables.

    ]]>
    - + +CRITICAL @@ -3468,7 +3769,8 @@ just use the constant. Methods detected are: a public reference. Consider using a internal private member variable to control synchronization.

    ]]>
    - + +CRITICAL @@ -3494,7 +3796,8 @@ or

    ]]>
    - + +CRITICAL @@ -3509,7 +3812,8 @@ to Math.round was intended to be performed using floating point arithmetic.

    ]]>
    - + +CRITICAL @@ -3524,7 +3828,8 @@ to Math.ceil was intended to be performed using double precision floating point arithmetic.

    ]]>
    - + +CRITICAL @@ -3549,7 +3854,8 @@ double value2 = x / (double) y; ]]> - + +CRITICAL @@ -3558,7 +3864,8 @@ This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result.

    ]]>
    - + +CRITICAL @@ -3567,7 +3874,8 @@ This code seems to be passing a non-serializable object to the ObjectOutput.writ If the object is, indeed, non-serializable, an error will result.

    ]]>
    - + +CRITICAL @@ -3581,7 +3889,8 @@ For example,

    would throw a MissingFormatArgumentException when executed.

    ]]>
    - + +CRITICAL @@ -3592,7 +3901,8 @@ For example, String.format("%d", "1") will generate an exception, s the String "1" is incompatible with the format specifier %d.

    ]]>
    - + +MAJOR @@ -3602,7 +3912,8 @@ exception; instead, it will print true for any nonnull value, and false for null This feature of format strings is strange, and may not be what you intended.

    ]]>
    - + +MAJOR @@ -3613,7 +3924,8 @@ of the array. Consider wrapping the array using Arrays.asList(...) before handling it off to a formatted.

    ]]>
    - + +CRITICAL @@ -3625,7 +3937,8 @@ but the number of arguments passed does not match with the number of author intended.

    ]]>
    - + +MAJOR @@ -3636,7 +3949,8 @@ This won't cause a runtime exception, but the code may be silently omitting information that was intended to be included in the formatted string.

    ]]>
    - + +CRITICAL @@ -3646,7 +3960,8 @@ and a runtime exception will occur when this statement is executed.

    ]]>
    - + +CRITICAL @@ -3656,7 +3971,8 @@ A runtime exception will occur when this statement is executed.

    ]]>
    - + +CRITICAL @@ -3672,7 +3988,8 @@ A runtime exception will occur when this statement is executed.

    ]]>
    - + +CRITICAL @@ -3682,7 +3999,8 @@ This code passes a primitive array to a function that takes a variable number of This creates an array of length one to hold the primitive array and passes it to the function.

    ]]>
    - + +CRITICAL @@ -3692,7 +4010,8 @@ about the type of o. It should simply return false if o is not the same type as this.

    ]]>
    - + +MAJOR @@ -3704,7 +4023,8 @@ you are casting to. If all you need is to be able to iterate through a collection, you don't need to cast it to a Set or List.

    ]]>
    - + +BLOCKER @@ -3712,7 +4032,8 @@ to iterate through a collection, you don't need to cast it to a Set or List. This cast will always throw a ClassCastException.

    ]]>
    - + +BLOCKER @@ -3722,7 +4043,8 @@ Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error.

    ]]>
    - + +CRITICAL @@ -3731,7 +4053,8 @@ This instanceof test will always return false. Although this is safe, make sure an indication of some misunderstanding or some other logic error.

    ]]>
    - + +CRITICAL @@ -3743,7 +4066,8 @@ If you really want to test the value for being null, perhaps it would be clearer better to do a null test rather than an instanceof test.

    ]]>
    - + +CRITICAL @@ -3753,7 +4077,8 @@ the type it is being cast to. Ensure that your program logic ensures that this cast will not fail.

    ]]>
    - + +CRITICAL @@ -3766,7 +4091,8 @@ point. Unless you have a particular reason to do so, just use the abstract collection class.

    ]]>
    - + +CRITICAL @@ -3778,7 +4104,8 @@ s.replaceAll(".", "/") will return a String in which every character has been replaced by a / character.

    ]]>
    - + +CRITICAL @@ -3788,7 +4115,8 @@ for regular expressions. This statement will throw a PatternSyntaxException when executed.

    ]]>
    - + +CRITICAL @@ -3802,7 +4130,8 @@ regular expression as an escape character. Amoung other options, you can just us

    ]]>
    - + +CRITICAL @@ -3812,7 +4141,8 @@ immediately overwrites it. For example, i = i++ immediately overwrites the incremented value with the original value.

    ]]>
    - + +CRITICAL @@ -3823,7 +4153,8 @@ Since the upper bits are discarded, there may be no difference between a signed and unsigned right shift (depending upon the size of the shift).

    ]]>
    - + +CRITICAL @@ -3835,7 +4166,8 @@ value to decide how much to shift by. This probably isn't want was expected, and it at least confusing.

    ]]>
    - + +CRITICAL @@ -3845,7 +4177,8 @@ Be sure you don't have your operator precedence confused. For example i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000).

    ]]>
    - + +CRITICAL @@ -3858,7 +4191,8 @@ use java.util.Arrays.hashCode(a).

    ]]>
    - + +CRITICAL @@ -3868,7 +4202,8 @@ such as [C@16f0472. Consider using Arrays.toString to convert the array into a r String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.

    ]]>
    - + +CRITICAL @@ -3878,7 +4213,8 @@ such as [C@16f0472. Consider using Arrays.toString to convert the array into a r String that gives the contents of the array. See Programming Puzzlers, chapter 3, puzzle 12.

    ]]>
    - + +CRITICAL @@ -3896,7 +4232,8 @@ in the JDK libraries, and Joshua Bloch publicized the bug pattern.

    ]]>
    - + +CRITICAL @@ -3906,7 +4243,8 @@ for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check for oddness, consider using x & 1 == 1, or x % 2 != 0.

    ]]>
    - + +CRITICAL @@ -3914,7 +4252,8 @@ for oddness, consider using x & 1 == 1, or x % 2 != 0. (e.g., new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment");

    ]]>
    - + +CRITICAL @@ -3923,7 +4262,8 @@ This code passes a constant month value outside the expected range of 0..11 to a method.

    ]]>
    - + +CRITICAL @@ -3931,7 +4271,8 @@ value outside the expected range of 0..11 to a method. This code invokes substring(0) on a String, which returns the original value.

    ]]>
    - + +CRITICAL @@ -3941,7 +4282,8 @@ since the hasNext() method is not supposed to change the state of the iterator, and the next method is supposed to change the state of the iterator.

    ]]>
    - + +CRITICAL @@ -3953,7 +4295,8 @@ and the next method is supposed to change the state of the iterator. to run.

    ]]>
    - + +CRITICAL @@ -3962,7 +4305,8 @@ and the next method is supposed to change the state of the iterator. Check to ensure that this isn't a coding mistake.

    ]]>
    - + +CRITICAL @@ -3972,7 +4316,8 @@ and the next method is supposed to change the state of the iterator. a coding mistake.

    ]]>
    - + +CRITICAL @@ -3989,7 +4334,8 @@ and the next method is supposed to change the state of the iterator.

    for details.

    ]]>
    - + +MINOR @@ -4000,7 +4346,8 @@ and the next method is supposed to change the state of the iterator. use for the field.

    ]]>
    - + +CRITICAL @@ -4010,7 +4357,8 @@ and the next method is supposed to change the state of the iterator. ==, not an assignment using =.

    ]]>
    - + +CRITICAL @@ -4022,7 +4370,8 @@ and the next method is supposed to change the state of the iterator. object being passed as a parameter is of an appropriate type.

    ]]>
    - + +CRITICAL @@ -4050,7 +4399,8 @@ and the next method is supposed to change the state of the iterator. Foo class) used to perform the equality checks.

    ]]>
    - + +CRITICAL @@ -4060,7 +4410,8 @@ problems if it were true (such as the computation of the hash code resulting in It is likely that the wrong value is being passed as a parameter.

    ]]>
    - + +CRITICAL @@ -4068,7 +4419,8 @@ It is likely that the wrong value is being passed as a parameter. always be true, and c.retainAll(c) should have no effect.

    ]]>
    - + +CRITICAL @@ -4076,7 +4428,8 @@ always be true, and c.retainAll(c) should have no effect. not c.removeAll(c).

    ]]>
    - + +CRITICAL @@ -4089,7 +4442,8 @@ random ArrayIndexOutOfBoundsExceptions or IndexOutOfBoundsExceptions in sun.util

    For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

    ]]>
    - + +CRITICAL @@ -4099,7 +4453,8 @@ field. This looks suspicous.

    For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

    ]]>
    - + +CRITICAL @@ -4111,7 +4466,8 @@ application.

    For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

    ]]>
    - + +CRITICAL @@ -4121,7 +4477,8 @@ field. This looks suspicous.

    For more information on this see Sun Bug #6231579 and Sun Bug #6178997.

    ]]>
    - + +CRITICAL @@ -4152,7 +4509,8 @@ public @NonNegative Integer example(@Negative Integer value) { ]]> - + +CRITICAL @@ -4172,7 +4530,8 @@ public @NonNegative Integer example(@Negative Integer value) { TODO: example

    ]]>
    - + +CRITICAL @@ -4183,7 +4542,8 @@ public @NonNegative Integer example(@Negative Integer value) { in a way that requires values denoted by that type qualifier.

    ]]>
    - + +CRITICAL @@ -4194,7 +4554,8 @@ public @NonNegative Integer example(@Negative Integer value) { in a way that prohibits values denoted by that type qualifier.

    ]]>
    - + +CRITICAL @@ -4204,7 +4565,8 @@ public @NonNegative Integer example(@Negative Integer value) { Either the usage or the annotation is incorrect.

    ]]>
    - + +CRITICAL @@ -4214,7 +4576,8 @@ public @NonNegative Integer example(@Negative Integer value) { Either the usage or the annotation is incorrect.

    ]]>
    - + +CRITICAL @@ -4232,7 +4595,8 @@ public @NonNegative Integer example(@Negative Integer value) { TODO: example.

    ]]>
    - + +CRITICAL @@ -4262,7 +4626,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    Bug pattern contributed by Jason Mehrens

    ]]>
    - + +CRITICAL @@ -4272,7 +4637,8 @@ public @NonNegative Integer example(@Negative Integer value) { through to the next case. Usually you need to end this case with a break or return.

    ]]>
    - + +MAJOR @@ -4282,7 +4648,8 @@ public @NonNegative Integer example(@Negative Integer value) { Usually you need to provide a default case.

    ]]>
    - + +CRITICAL @@ -4293,7 +4660,8 @@ public @NonNegative Integer example(@Negative Integer value) { break or return at the end of the previous case.

    ]]>
    - + +CRITICAL @@ -4303,7 +4671,8 @@ public @NonNegative Integer example(@Negative Integer value) { It is likely that you forgot to put a break or return at the end of the previous case.

    ]]>
    - + +MAJOR @@ -4314,7 +4683,8 @@ public @NonNegative Integer example(@Negative Integer value) { (unless the abbreviation is much more widely used than the long form, such as URL or HTML).

    ]]>
    - + +MAJOR @@ -4324,7 +4694,8 @@ public @NonNegative Integer example(@Negative Integer value) { with a lowercase first letter and the first letters of subsequent words capitalized.

    ]]>
    - + +MAJOR @@ -4334,7 +4705,8 @@ public @NonNegative Integer example(@Negative Integer value) { with the first letter of each internal word capitalized.

    ]]>
    - + +MAJOR @@ -4346,7 +4718,8 @@ public @NonNegative Integer example(@Negative Integer value) { Objects of this class will not be deserialized correctly if a non-Serializable object is stored in this field.

    ]]>
    - + +CRITICAL @@ -4357,7 +4730,8 @@ public @NonNegative Integer example(@Negative Integer value) { in java.lang.Object, which is probably what was intended.

    ]]>
    - + +CRITICAL @@ -4368,7 +4742,8 @@ public @NonNegative Integer example(@Negative Integer value) { method in java.lang.Object, which is probably what was intended.

    ]]>
    - + +MAJOR @@ -4379,7 +4754,8 @@ public @NonNegative Integer example(@Negative Integer value) { method in java.lang.Object, which is probably what was intended.

    ]]>
    - + +MAJOR @@ -4391,7 +4767,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4401,7 +4778,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4416,7 +4794,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4426,7 +4805,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4437,7 +4817,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4446,7 +4827,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4455,7 +4837,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4494,7 +4877,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4503,7 +4887,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO @@ -4512,7 +4897,8 @@ public @NonNegative Integer example(@Negative Integer value) {

    ]]>
    - + +INFO diff --git a/plugins/sonar-pmd-plugin/src/main/resources/org/sonar/plugins/pmd/rules.xml b/plugins/sonar-pmd-plugin/src/main/resources/org/sonar/plugins/pmd/rules.xml index c8d5c5fa473..dc94cd19443 100644 --- a/plugins/sonar-pmd-plugin/src/main/resources/org/sonar/plugins/pmd/rules.xml +++ b/plugins/sonar-pmd-plugin/src/main/resources/org/sonar/plugins/pmd/rules.xml @@ -1,6 +1,7 @@ - + +MAJOR rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException @@ -20,7 +21,8 @@ public class Foo { ]]> - + +MAJOR rulesets/android.xml/CallSuperFirst @@ -36,7 +38,8 @@ public class DummyActivity extends Activity { ]]> - + +MAJOR rulesets/android.xml/CallSuperLast @@ -52,7 +55,8 @@ public class DummyActivity extends Activity { ]]> - + +MAJOR rulesets/android.xml/ProtectLogD @@ -71,7 +75,8 @@ public class DummyActivity extends Activity { ]]> - + +MAJOR rulesets/android.xml/ProtectLogV @@ -91,7 +96,8 @@ public class DummyActivity extends Activity { - + +MAJOR rulesets/basic.xml/EmptyInitializer @@ -112,7 +118,8 @@ public class Foo { - + +MAJOR rulesets/codesize.xml/CyclomaticComplexity @@ -133,7 +140,8 @@ public class Foo { - + +MAJOR rulesets/strings.xml/AvoidStringBufferField @@ -146,7 +154,8 @@ class Foo { ]]> - + +MAJOR @@ -173,7 +182,8 @@ public class Foo ]]> - + +MAJOR @@ -185,7 +195,8 @@ public class Foo - + +MINOR @@ -211,7 +222,8 @@ public class Example ]]> - + +MINOR @@ -237,7 +249,8 @@ public class Foo { - + +MAJOR @@ -252,7 +265,8 @@ public class abstract Example { - + +CRITICAL @@ -279,7 +293,8 @@ public class abstract Example { ]]> - + +MAJOR @@ -307,7 +322,8 @@ int j = -~7; - + +MAJOR @@ -330,7 +346,8 @@ public class Foo { ]]> - + +MAJOR @@ -350,7 +367,8 @@ public class Foo { - + +MINOR @@ -374,7 +392,8 @@ public class Foo { ]]> - + +MAJOR @@ -392,7 +411,8 @@ public class Bar { ]]> - + +MAJOR @@ -411,7 +431,8 @@ public class Foo { ]]> - + +MAJOR @@ -434,7 +455,8 @@ public class Foo { - + +MAJOR @@ -447,7 +469,8 @@ public class Foo { //Should be final ]]> - + +MAJOR @@ -462,7 +485,8 @@ public class MyClass { ]]> - + +MINOR @@ -477,7 +501,8 @@ public class Foo { ]]> - + +CRITICAL @@ -511,7 +536,8 @@ public class Foo { - + +INFO @@ -524,7 +550,8 @@ public class Foo {} ]]> - + +MINOR @@ -541,7 +568,8 @@ public class Bar { - + +MAJOR @@ -553,7 +581,8 @@ public abstract class Foo { // should be AbstractFoo ]]> - + +MAJOR @@ -567,7 +596,8 @@ public class ClassInDefaultPackage { - + +MAJOR @@ -580,7 +610,8 @@ public class SomeClass { ]]> - + +MAJOR @@ -594,7 +625,8 @@ Byte.valueOf(0); ]]> - + +MAJOR @@ -609,7 +641,8 @@ Short.valueOf(0); - + +MAJOR @@ -623,7 +656,8 @@ Long.valueOf(0); ]]> - + +CRITICAL @@ -645,153 +679,177 @@ class Foo{ - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MINOR - + +INFO - + +MAJOR - + +MAJOR - + +MINOR - + +MAJOR - + +MINOR - + +MINOR - + +MINOR - + +MAJOR - + +MAJOR @@ -807,7 +865,8 @@ class Foo{ - + +MAJOR @@ -818,7 +877,8 @@ class Foo{ - + +MAJOR @@ -829,68 +889,79 @@ class Foo{ - + +MAJOR - + +MINOR - + +MINOR - + +MAJOR - + +MINOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +CRITICAL - + +CRITICAL @@ -901,38 +972,44 @@ class Foo{ - + +CRITICAL - + +CRITICAL - + +MAJOR - + +CRITICAL - + +MAJOR - + +MAJOR @@ -949,101 +1026,117 @@ public class JumbledIncrementerRule1 { } }]]> - + +MINOR - + +MAJOR - + +MAJOR - + +CRITICAL - + +MINOR - + +MAJOR - + +CRITICAL - + +MAJOR - + +MAJOR - + +INFO - + +MINOR - + +MAJOR - + +MAJOR - + +MAJOR - + +CRITICAL - + +CRITICAL @@ -1057,47 +1150,54 @@ if (object1!=null && object2.equals(object1)) { } ]]> - + +MAJOR - + +CRITICAL - + +CRITICAL - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -1107,13 +1207,15 @@ if (object1!=null && object2.equals(object1)) { - + +MAJOR - + +MAJOR @@ -1124,7 +1226,8 @@ if (object1!=null && object2.equals(object1)) { - + +MAJOR @@ -1157,20 +1260,23 @@ public class JuniorClass extends SeniorClass { } ]]> - + +MAJOR - + +MINOR - + +MAJOR @@ -1191,177 +1297,205 @@ try { - + +MAJOR public class MyClass {
    // this block gets run before any call to a constructor {
    System.out.println("I am about to construct myself");
    }
    }
    ]]>
    - + +MAJOR - + +MAJOR - + +MAJOR - + +CRITICAL - + +MAJOR - + +MAJOR Class c = new String().getClass(); with Class c = String.class;]]> - + +MAJOR int x = 2;
    x = x;
    ]]>
    - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +CRITICAL - + +MAJOR - + +MINOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -1372,93 +1506,107 @@ try { - + +MAJOR - + +MAJOR - + +MAJOR - + +MINOR - + +CRITICAL - + +CRITICAL - + +CRITICAL - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -1469,20 +1617,23 @@ try { - + +MAJOR - + +MAJOR - + +MAJOR @@ -1516,44 +1667,51 @@ public class Foo { - + +MAJOR - + +MAJOR - + +MAJOR - + +MINOR - + +MINOR - + +MINOR - + +MINOR @@ -1563,39 +1721,45 @@ public class Foo { - + +MAJOR - + +MAJOR - + +MAJOR - + +MINOR - + +MAJOR - + +MAJOR @@ -1606,7 +1770,8 @@ public class Foo { - + +MAJOR @@ -1617,7 +1782,8 @@ public class Foo { - + +MAJOR @@ -1628,7 +1794,8 @@ public class Foo { - + +MAJOR @@ -1639,7 +1806,8 @@ public class Foo { - + +MAJOR @@ -1650,7 +1818,8 @@ public class Foo { - + +MAJOR @@ -1660,7 +1829,8 @@ public class Foo { - + +MAJOR @@ -1670,7 +1840,8 @@ public class Foo { - + +MAJOR @@ -1680,37 +1851,43 @@ public class Foo { - + +MINOR - + +MINOR - + +MINOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -1721,13 +1898,15 @@ public class Foo { - + +MAJOR - + +MAJOR @@ -1737,7 +1916,8 @@ public class Foo { - + +MAJOR @@ -1749,7 +1929,8 @@ public class ShortMethod { } ]]> - + +MAJOR @@ -1772,7 +1953,8 @@ public class ShortMethod { - + +MAJOR rulesets/naming.xml/MethodNamingConventions @@ -1784,19 +1966,22 @@ public class Foo { } }]]> - + +MAJOR - + +MINOR - + +MAJOR @@ -1810,7 +1995,8 @@ public class MyClass { } ]]> - + +MAJOR @@ -1822,7 +2008,8 @@ public class Foo { } }]]> - + +MAJOR @@ -1836,7 +2023,8 @@ public class Foo { } ]]> - + +CRITICAL @@ -1853,7 +2041,8 @@ public class Foo { } ]]> - + +MAJOR @@ -1866,7 +2055,8 @@ public class Foo extends Bar { } ]]> - + +MAJOR @@ -1881,7 +2071,8 @@ public class Foo { } ]]> - + +MAJOR @@ -1895,91 +2086,106 @@ public class Foo { } ]]> - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR for (int i=0; i<42;i++) foo();]]> - + +MAJOR @@ -1989,42 +2195,48 @@ public class Foo { - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -2045,7 +2257,8 @@ public abstract class ShouldBeAbstract } ]]> - + +MAJOR @@ -2056,74 +2269,86 @@ public abstract class ShouldBeAbstract - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR - + +MAJOR @@ -2133,7 +2358,8 @@ public abstract class ShouldBeAbstract - + +MAJOR -- 2.39.5