From: simonbrandhof Date: Fri, 3 Dec 2010 11:50:44 +0000 (+0000) Subject: SONAR-2007 remove iso categories from checkstyle, pmd and findbugs X-Git-Tag: 2.6~428 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4de9f9f8e864a3564e6f2fe316424ec80280e5a4;p=sonarqube.git SONAR-2007 remove iso categories from checkstyle, pmd and findbugs --- 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 82113c75f49..6db38481782 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 @@ -4,7 +4,7 @@ - + Checks that a source file begins with a specified header. Property headerFile specifies a file that contains the required header. Alternatively, the header specification can be set directly in the header property without the need for an external file.

Property ignoreLines specifies the line numbers to ignore when matching lines in a header file. This property is very useful for supporting headers that contain copyright dates. For example, consider the following header:

@@ -26,7 +26,7 @@
   
     
     
-    
+
     Checks the header of a source file against a header that contains a regular expression for each line of the source header.

Rationale: In some projects checking against a fixed header is not sufficient, e.g. the header might require a copyright line where the year information is not static. For example, consider the following header:

@@ -68,7 +68,7 @@
   
     
     
-    
+
     
     
       
@@ -84,7 +84,7 @@
   
     
     
-    
+    
     
       
   
@@ -92,7 +92,7 @@
   
     
     
-    
+    
     
       
     
@@ -104,7 +104,7 @@
   
     
     
-    
+    
     This check makes sure that all package annotations are in the package-info.java file.

According to the Java JLS 3rd ed.

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.

]]>
@@ -113,7 +113,7 @@ - + This check allows you to specify what warnings that SuppressWarnings is not allowed to suppress. You can also specify a list of TokenTypes that the configured warning(s) cannot be suppressed on.

Limitations: This check does not consider conditionals inside the SuppressWarnings annotation. @@ -131,7 +131,7 @@ For example: @SupressWarnings((false) ? (true) ? "unchecked" : "foo" : "unused") - + Checks that any combination of String literals with optional assignment is on the left side of an equals() comparison.

Rationale: Calling the equals() method on String literals will avoid a potential NullPointerException. Also, it is pretty common to see null check right before equals comparisons which is not necessary in the below example.

@@ -164,7 +164,7 @@ should be refactored to: - + Checks that the clone method is not overridden from the Object class.

Rationale: The clone method relies on strange/hard to follow rules that do not work it all situations. Consequently, it is difficult to override correctly. Below are some of the rules/reasons why the clone method should be avoided. @@ -210,14 +210,14 @@ should be refactored to: - + Verifies there are no finalize() methods defined in a class.

]]>
- + Checks that there are no static import statements. Rationale: Importing static members can lead to naming conflicts between class' members. It may lead to poor code readability since it may no longer be clear what class a member resides in (without looking at the import statement).

]]>
@@ -230,7 +230,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + Checks that each Java package has a Javadoc file used for commenting. By default it only allows a package-info.java file, but can be configured to allow a package.html file. An error will be reported if both files exist as this is not allowed by the Javadoc tool.

]]>
@@ -241,7 +241,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + MULTIPLE A check for detecting that matches across multiple lines. Rationale: This check can be used to when the regular expression can be span multiple lines.

]]>
@@ -264,7 +264,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + A check for detecting single lines that match a supplied regular expression. Works with any file type. Rationale: This check can be used to prototype checks and to find common bad practice such as calling ex.printStacktrace(), System.out.println(), System.exit(), etc.

]]>
MULTIPLE @@ -287,7 +287,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + This class is variation on RegexpSingleline for detecting single lines that match a supplied regular expression in Java files. It supports suppressing matches in Java comments.

]]>
MULTIPLE @@ -313,7 +313,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + Checks for the number of types declared at the outer (or root) level in a file. Rationale: It is considered good practice to only define one outer type per file.

]]>
@@ -323,7 +323,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + Checks that there are no tab characters ('\t') in the source code. Rationale:
  • Developers should not need to configure the tab width of their text editors in order to be able to read source code.
  • @@ -337,7 +337,7 @@ For example: Excluding java.lang.Math.*. will allow the import of each static me - + Checks that the whitespace around the Generic tokens < and > is correct to the typical convention. The convention is not configurable.

    For example the following is legal: @@ -362,7 +362,7 @@ But the following example is not: - + - +

  • It is a duplicate of another import. This is, when a class is imported more than once.
  • @@ -398,7 +398,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -409,7 +409,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -418,13 +418,13 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -435,13 +435,13 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -450,7 +450,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -460,7 +460,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -474,7 +474,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -484,7 +484,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -493,7 +493,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -504,14 +504,14 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -521,33 +521,33 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - +
  • 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
]]>
- + - + - + - + @@ -560,7 +560,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + for ( ; i < j; i++, j--)]]> @@ -570,7 +570,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + for (Iterator foo = very.long.line.iterator(); foo.hasNext(); )]]> @@ -580,19 +580,19 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + - + @@ -606,14 +606,14 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -628,7 +628,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + Checks for long source files.

Rationale: If a source file becomes very long it is hard to understand. Therefore long classes should usually be refactored into several individual classes that focus on a specific task.

]]>
@@ -638,13 +638,13 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -654,7 +654,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -664,7 +664,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -690,14 +690,14 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -707,7 +707,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -716,7 +716,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + java.lang.Boolean class. In order to save memory and CPU cycles, it is preferable to use the predefined constants TRUE and FALSE. Constructor invocations should be replaced by calls to Boolean.valueOf(). Some extremely performance sensitive projects may require the use of factory methods for other classes as well, to enforce the usage of number caches or object pools.]]> @@ -726,7 +726,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -736,7 +736,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -746,7 +746,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + MULTIPLE @@ -766,7 +766,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -789,7 +789,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - +
  • groups imports: ensures that groups of imports come in a specific order (e.g., java. comes first, javax. comes second, then everything else)
  • adds a separation between groups : ensures that a blank line sit between each group
  • @@ -822,7 +822,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -838,7 +838,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -861,7 +861,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - +
  • Ensures the first sentence ends with proper punctuation (That is a period, question mark, or exclamation mark, by default). @@ -968,7 +968,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -1008,7 +1008,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + eol and nlow take into account property maxLineLength.]]> @@ -1027,7 +1027,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1044,7 +1044,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1055,7 +1055,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1070,7 +1070,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1082,7 +1082,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1105,7 +1105,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1121,7 +1121,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1131,7 +1131,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1148,27 +1148,27 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + - + - + @@ -1176,7 +1176,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain MULTIPLE - + @@ -1194,14 +1194,14 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -1212,7 +1212,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1223,7 +1223,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1232,7 +1232,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1241,7 +1241,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1250,7 +1250,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1265,7 +1265,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1279,7 +1279,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1292,7 +1292,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1307,14 +1307,14 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -1325,13 +1325,13 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + @@ -1342,7 +1342,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1356,7 +1356,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1369,7 +1369,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1378,7 +1378,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1393,7 +1393,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + MULTIPLE @@ -1424,7 +1424,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1437,7 +1437,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1449,7 +1449,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1463,19 +1463,19 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + - + @@ -1485,7 +1485,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1498,25 +1498,25 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + - + - + @@ -1525,7 +1525,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + MULTIPLE @@ -1535,7 +1535,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1552,7 +1552,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1565,7 +1565,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1578,7 +1578,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1592,7 +1592,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1603,26 +1603,26 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + - + - + Section 3.10.1.]]> - + @@ -1639,7 +1639,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1649,7 +1649,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + @@ -1667,7 +1667,7 @@ Rationale: Too large methods and classes are hard to read and costly to maintain - + 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 909109f919c..577575cd2c5 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 @@ -3,14 +3,14 @@ - + - + This code is casting the result of calling toArray() on a collection to a type more specific than Object[], as in:

       String[] getAsArray(Collection c) {
    @@ -24,21 +24,21 @@
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         OpenJDK introduces a potential incompatibility. In particular, the java.util.logging.Logger behavior has changed. Instead of using strong references, it now uses weak references internally. That's a reasonable change, but unfortunately some code relies on the old behavior - when changing logger configuration, it simply drops the logger reference. That means that the garbage collector is free to reclaim that memory, which means that the logger configuration is lost. For example, consider:

    public static void initLogging() throws Exception { @@ -61,7 +61,7 @@ - + @@ -69,7 +69,7 @@ - + @@ -77,7 +77,7 @@ - + @@ -85,7 +85,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -101,7 +101,7 @@ - + This method is invoked in the constructor of of the superclass. At this point, the fields of the class have not yet initialized. To make this more concrete, consider the following classes:

       abstract class A {
    @@ -127,7 +127,7 @@
       
         
         
    -    
    +    
         
           
       
    @@ -137,32 +137,32 @@
       
         
         
    -    
    +    
         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.

    ]]>
    - + 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.

    ]]>
    - + 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.

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

    ]]>
    - + (Javadoc) A ScheduledThreadPoolExecutor with zero core threads will never execute anything; changes to the max pool size are ignored.

    ]]>
    @@ -170,7 +170,7 @@ A ScheduledThreadPoolExecutor with zero core threads will never execute anything - + (Javadoc) 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.

    ]]>
    @@ -178,21 +178,21 @@ While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the - + All targets of this method invocation throw an UnsupportedOperationException.

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

    ]]>
    - + This code creates a database connect using a hardcoded, constant password. Anyone with access to either the source code or the compiled code can easily learn the password.

    ]]>
    @@ -200,7 +200,7 @@ While ScheduledThreadPoolExecutor inherits from ThreadPoolExecutor, a few of the - + This code constructs an HTTP Cookie using an untrusted HTTP parameter. If this cookie is added to an HTTP response, it will allow a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information.

    @@ -213,7 +213,7 @@ consider using a commercial static analysis or pen-testing tool. - + This code directly writes an HTTP parameter to an HTTP header, which allows for a HTTP response splitting vulnerability. See http://en.wikipedia.org/wiki/HTTP_response_splitting for more information.

    @@ -226,7 +226,7 @@ consider using a commercial static analysis or pen-testing tool. - + This code directly writes an HTTP parameter to Servlet output, which allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information.

    @@ -239,7 +239,7 @@ consider using a commercial static analysis or pen-testing tool. - + This code directly writes an HTTP parameter to a Server error page (using HttpServletResponse.sendError). Echoing this untrusted input allows for a reflected cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting @@ -253,7 +253,7 @@ consider using a commercial static analysis or pen-testing tool. - + This code directly writes an HTTP parameter to JSP output, which allows for a cross site scripting vulnerability. See http://en.wikipedia.org/wiki/Cross-site_scripting for more information.

    @@ -266,7 +266,7 @@ consider using a commercial static analysis or pen-testing tool. - + (From JDC Tech Tip): The Swing methods show(), setVisible(), and pack() will create the associated peer for the frame. With the creation of the peer, the system creates the event dispatch thread. @@ -280,21 +280,21 @@ visible), they could trigger listener notification on the event dispatch thread. - + This loop doesn't seem to have a way to terminate (other than by perhaps throwing an exception).

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

    ]]>
    - + A collection is added to itself. As a result, computing the hashCode of this set will throw a StackOverflowException.

    ]]>
    @@ -303,7 +303,7 @@ set will throw a StackOverflowException. - + This declares a volatile reference to an array, which might not be what you want. With a volatile reference to an array, reads and writes of the reference to the array are treated as volatile, but the array elements @@ -314,7 +314,7 @@ in Java 5.0).

    ]]>
    - + Calling this.getClass().getResource(...) could give results other than expected if this class is extended by a class in another package.

    ]]>
    @@ -322,7 +322,7 @@ another package.

    ]]>
    - + A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and @@ -333,7 +333,7 @@ another package.

    ]]>
    - + Since the field is synchronized on, it seems not likely to be null. If it is null and then synchronized on a NullPointerException will be thrown and the check would be pointless. Better to synchronize on @@ -342,7 +342,7 @@ another field.

    ]]>
    - + The code contains a conditional test is performed twice, one right after the other (e.g., x == 0 || x == 0). Perhaps the second occurrence is intended to be something else (e.g., x == 0 || y == 0). @@ -351,7 +351,7 @@ another field.

    ]]>
    - + The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty ZipFile entry. The contents of the entry @@ -362,7 +362,7 @@ should be written to the ZipFile between the calls to - + The code calls putNextEntry(), immediately followed by a call to closeEntry(). This results in an empty JarFile entry. The contents of the entry @@ -373,7 +373,7 @@ should be written to the JarFile between the calls to - + IllegalMonitorStateException is generally only thrown in case of a design flaw in your code (calling wait or notify on an object you do not hold a lock on).

    ]]>
    @@ -381,7 +381,7 @@ should be written to the JarFile between the calls to - + The method performs math operations using floating point precision. Floating point precision is very imprecise. For example, @@ -390,7 +390,7 @@ should be written to the JarFile between the calls to - + Class implements Cloneable but does not define or use the clone method.

    ]]>
    @@ -398,7 +398,7 @@ should be written to the JarFile between the calls to - + This class defines a clone() method but the class doesn't implement Cloneable. There are some situations in which this is OK (e.g., you want to control how subclasses can clone themselves), but just make sure that this is what you intended. @@ -407,7 +407,7 @@ can clone themselves), but just make sure that this is what you intended. - + This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that @@ -420,14 +420,14 @@ to use Object.clone(), which always returns an object of the correct type.

    ]] - + 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.

    ]]>
    - + This identifier is used as a keyword in later versions of Java. This code, and any code that references this API, will need to be changed in order to compile it in later versions of Java.

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

    ]]> - + This method might drop an exception.  In general, exceptions should be handled or reported in some way, or they should be thrown out of the method.

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

    ]]> - + This method might ignore an exception.  In general, exceptions should be handled or reported in some way, or they should be thrown out of the method.

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

    ]]> - + This code invokes a method that requires a security permission check. 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.

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

    ]]> - + This code creates a classloader, which requires a security manager. 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.

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

    ]]> - + The class is annotated with net.jcip.annotations.Immutable, and the rules for that annotation require that all fields are final. .

    ]]>
    @@ -475,7 +475,7 @@ that all fields are final. - + A Thread object is passed as a parameter to a method where a Runnable is expected. This is rather unusual, and may indicate a logic error or cause unexpected behavior. @@ -484,7 +484,7 @@ or cause unexpected behavior. - + This method or field is or uses a Map or Set of URLs. Since both the equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. @@ -494,7 +494,7 @@ Consider using java.net.URI instead. - + The equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. @@ -505,7 +505,7 @@ Consider using java.net.URI instead. - + Unless an annotation has itself been annotated with @Retention(RetentionPolicy.RUNTIME), the annotation can't be observed using reflection (e.g., by using the isAnnotationPresent method). .

    ]]>
    @@ -513,7 +513,7 @@ Consider using java.net.URI instead. - + Invoking System.exit shuts down the entire Java virtual machine. This should only been done when it is appropriate. Such calls make it hard or impossible for your code to be invoked by other code. @@ -522,7 +522,7 @@ Consider using java.net.URI instead. - + Never call System.runFinalizersOnExit or Runtime.runFinalizersOnExit for any reason: they are among the most dangerous methods in the Java libraries. -- Joshua Bloch

    ]]>
    @@ -530,7 +530,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + Using the java.lang.String(String) constructor wastes memory because the object so constructed will be functionally indistinguishable from the String passed as a parameter.  Just use the @@ -539,7 +539,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant @@ -550,14 +550,14 @@ dangerous methods in the Java libraries. -- Joshua Bloch

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

    ]]>
    - + Code explicitly invokes garbage collection. Except for specific use in benchmarking, this is very dubious.

    In the past, situations where people have explicitly invoked @@ -570,7 +570,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + Creating new instances of java.lang.Boolean wastes memory, since Boolean objects are immutable and there are only two useful values of this type.  Use the Boolean.valueOf() @@ -579,7 +579,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + Using new Integer(int) is guaranteed to always result in a new object whereas Integer.valueOf(int) allows caching of values to be done by the compiler, class library, or JVM. @@ -600,7 +600,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + Using new Double(double) is guaranteed to always result in a new object whereas Double.valueOf(double) allows caching of values to be done by the compiler, class library, or JVM. @@ -614,7 +614,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

    String.toUpperCase( Locale l )
    String.toLowerCase( Locale l )
    @@ -623,7 +623,7 @@ dangerous methods in the Java libraries. -- Joshua Bloch

    ]]> - + A wrapped primitive value is unboxed and converted to another primitive type as part of the evaluation of a conditional ternary operator (the b ? e1 : e2 operator). The semantics of Java mandate that if e1 and e2 are wrapped @@ -636,7 +636,7 @@ converted to a floating point value, and boxed. See JLS Section 15.25. - + A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing. @@ -645,14 +645,14 @@ to immediately undo the work of the boxing. - + 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).

    ]]>
    - + A boxed primitive is allocated just to call toString(). It is more effective to just use the static form of toString which takes the primitive value. So,

    @@ -669,14 +669,14 @@ to immediately undo the work of the boxing. - + 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.

    ]]>
    - + This method calls wait() on a java.util.concurrent.locks.Condition object.  @@ -687,7 +687,7 @@ to immediately undo the work of the boxing. - + A random value from 0 to 1 is being coerced to the integer value 0. You probably want to multiple the random value by something else before coercing it to an integer, or use the Random.nextInt(n) method.

    ]]>
    @@ -696,7 +696,7 @@ want to multiple the random value by something else before coercing it to an int - + If r is a java.util.Random, you can generate a random number from 0 to n-1 using r.nextInt(n), rather than using (int)(r.nextDouble() * n).

    ]]>
    @@ -704,7 +704,7 @@ using r.nextInt(n), rather than using (int)(r.nextDouble() * - + The method invokes the execute method on an SQL statement with a String that seems to be dynamically generated. Consider using a prepared statement instead. It is more efficient and less vulnerable to @@ -714,7 +714,7 @@ SQL injection attacks. - + The code creates an SQL prepared statement from a nonconstant String. If unchecked, tainted data from a user is used in building this String, SQL injection could be used to make the prepared statement do something unexpected and undesirable. @@ -723,7 +723,7 @@ be used to make the prepared statement do something unexpected and undesirable. - + This method creates a thread without specifying a run method either by deriving from the Thread class, or by passing a Runnable object. This thread, then, does nothing but waste time.

    ]]>
    @@ -731,7 +731,7 @@ be used to make the prepared statement do something unexpected and undesirable. - + This method may contain an instance of double-checked locking.  This idiom is not correct according to the semantics of the Java memory model.  For more information, see the web page @@ -741,14 +741,14 @@ be used to make the prepared statement do something unexpected and undesirable. - + 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.]]> - + This finalizer does nothing except null out fields. This is completely pointless, and requires that the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method.]]> @@ -756,21 +756,21 @@ method.]]> - + A class's finalize() method should have protected access, not public.

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

    ]]>
    - + This empty finalize() method explicitly negates the effect of any finalizer defined by its superclass.  Any finalizer actions defined for the superclass will not be performed.  @@ -779,7 +779,7 @@ method.]]> - + The only thing this finalize() method does is call the superclass's finalize() method, making it redundant.  Delete it.

    ]]>
    @@ -787,7 +787,7 @@ method.]]>
    - + This finalize() method does not make a call to its superclass's finalize() method.  So, any finalizer actions defined for the superclass will not be performed.  @@ -796,7 +796,7 @@ method.]]> - + This method contains an explicit invocation of the finalize() method on an object.  Because finalizer methods are supposed to be executed once, and only by the VM, this is a bad idea.

    @@ -808,7 +808,7 @@ on objects referenced by X, because they may already be getting finalized in a s - + This equals method is checking to see if the argument is some incompatible type (i.e., a class that is neither a supertype nor subtype of the class that defines the equals method). For example, the Foo class might have an equals method @@ -830,7 +830,7 @@ is symmetric and transitive. Without those properties, very unexpected behavoirs - + This class defines an enumeration, and equality on enumerations are defined using object identity. Defining a covariant equals method for an enumeration value is exceptionally bad practice, since it would likely result @@ -842,7 +842,7 @@ Don't do it. - + This class defines a covariant version of the equals() method, but inherits the normal equals(Object) method defined in the base java.lang.Object class.  @@ -852,7 +852,7 @@ Don't do it. - + This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class.  @@ -862,7 +862,7 @@ Don't do it. - + This class defines an equals() method, that doesn't override the normal equals(Object) method defined in the base java.lang.Object class.  Instead, it @@ -875,7 +875,7 @@ Don't do it. - + This class extends a class that defines an equals method and adds fields, but doesn't define an equals method itself. Thus, equality on instances of this class will ignore the identity of the subclass and the added fields. Be sure this is what is intended, @@ -888,7 +888,7 @@ invoking super.equals(o). - + This class defines a covariant version of equals().  To correctly override the equals() method in java.lang.Object, the parameter of equals() @@ -897,7 +897,7 @@ invoking super.equals(o). - + This class defines an equals method that overrides an equals method in a superclass. Both equals methods methods use instanceof in the determination of whether two objects are equal. This is fraught with peril, since it is important that the equals method is symmetrical (in other words, a.equals(b) == b.equals(a)). @@ -909,7 +909,7 @@ methods is not symmetric. - + This class has an equals method that will be broken if it is inherited by subclasses. It compares a class literal with the class of the argument (e.g., in class Foo it might check if Foo.class == o.getClass()). @@ -919,7 +919,7 @@ It is better to check if this.getClass() == o.getClass(). - + This class doesn't do any of the patterns we recognize for checking that the type of the argument is compatible with the type of the this object. There might not be anything wrong with this code, but it is worth reviewing. @@ -928,7 +928,7 @@ this code, but it is worth reviewing. - + This method checks to see if two objects are the same class by checking to see if the names of their classes are equal. You can have different classes with the same name if they are loaded by different class loaders. Just check to see if the class objects are the same. @@ -937,7 +937,7 @@ different class loaders. Just check to see if the class objects are the same. - + This class defines an equals method that always returns true. This is imaginative, but not very smart. Plus, it means that the equals method is not symmetric.

    ]]>
    @@ -945,7 +945,7 @@ Plus, it means that the equals method is not symmetric. - + This class defines an equals method that always returns false. This means that an object is not equal to itself, and it is impossible to create useful Maps or Sets of this class. More fundamentally, it means that equals is not reflexive, one of the requirements of the equals method.

    The likely intended semantics are object identity: that an object is equal to itself. This is the behavior inherited from class Object. If you need to override an equals inherited from a different @@ -958,7 +958,7 @@ public boolean equals(Object o) { return this == o; } - + A large String constant is duplicated across multiple class files. This is likely because a final field is initialized to a String constant, and the Java language @@ -971,7 +971,7 @@ that classfile. See - + A parameter to this method has been identified as a value that should always be checked to see whether or not it is null, but it is being dereferenced @@ -981,7 +981,7 @@ that classfile. See - + This implementation of equals(Object) violates the contract defined by java.lang.Object.equals() because it does not check for null @@ -992,7 +992,7 @@ that classfile. See - + This class defines a covariant version of compareTo().  To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() @@ -1001,7 +1001,7 @@ that classfile. See - + A method, field or class declares a generic signature where a non-hashable class is used in context where a hashable class is required. A class that declares an equals method but inherits a hashCode() method @@ -1012,7 +1012,7 @@ equal objects have equal hashCodes. - + A class defines an equals(Object) method but not a hashCode() method, 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 @@ -1021,7 +1021,7 @@ fix this problem of highest importance.]]> - + This class defines a hashCode() method but inherits its equals() method from java.lang.Object (which defines equality by comparing object references).  Although @@ -1040,7 +1040,7 @@ the recommended hashCode implementation to use is:

    - + This class defines a compareTo(...) method but inherits its equals() method from java.lang.Object. Generally, the value of compareTo should return zero if and only if @@ -1060,7 +1060,7 @@ is "Note: this class has a natural ordering that is inconsistent with equals." - + This class defines a hashCode() method but not an equals() method.  Therefore, the class may violate the invariant that equal objects must have equal hashcodes.

    ]]>
    @@ -1068,7 +1068,7 @@ is "Note: this class has a natural ordering that is inconsistent with equals." - + This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns @@ -1086,7 +1086,7 @@ the recommended hashCode implementation to use is:

    - + This class inherits equals(Object) from an abstract superclass, and hashCode() from java.lang.Object (which returns @@ -1102,7 +1102,7 @@ the recommended hashCode implementation to use is:

    - + This class overrides equals(Object), but does not override hashCode().  Therefore, the class may violate the invariant that equal objects must have equal hashcodes.

    ]]>
    @@ -1110,7 +1110,7 @@ the recommended hashCode implementation to use is:

    - + This class defines a covariant version of equals().  To correctly override the equals() method in java.lang.Object, the parameter of equals() @@ -1119,7 +1119,7 @@ the recommended hashCode implementation to use is:

    - + This code compares java.lang.String objects for reference equality using the == or != operators. Unless both strings are either constants in a source file, or have been @@ -1130,7 +1130,7 @@ using the equals(Object) method instead.

    ]]>
    - + This code compares a java.lang.String parameter for reference equality using the == or != operators. Requiring callers to pass only String constants or interned strings to a method is unnecessarily @@ -1140,7 +1140,7 @@ using the equals(Object) method instead.

    ]]>
    - + This class defines a covariant version of compareTo().  To correctly override the compareTo() method in the Comparable interface, the parameter of compareTo() @@ -1149,14 +1149,14 @@ using the equals(Object) method instead.

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

    ]]>
    - + A web server generally only creates one instance of servlet or jsp class (i.e., treats the class as a Singleton), and will @@ -1167,7 +1167,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + The fields of this class appear to be accessed inconsistently with respect to synchronization.  This bug report indicates that the bug pattern detector judged that @@ -1195,7 +1195,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + A call to notify() or notifyAll() was made without any (apparent) accompanying modification to mutable object state.  In general, calling a notify @@ -1211,7 +1211,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + A public static method returns a reference to an array that is part of the static state of the class. Any code that calls this method can freely modify @@ -1222,7 +1222,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + Returning a reference to a mutable object value stored in one of the object's fields exposes the internal representation of the object.  If instances @@ -1235,7 +1235,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + This code stores a reference to an externally mutable object into the internal representation of the object.  If instances @@ -1248,7 +1248,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + This code stores a reference to an externally mutable object into a static field. If unchecked changes to @@ -1259,7 +1259,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + This method explicitly invokes run() on an object.  In general, classes implement the Runnable interface because they are going to have their run() method invoked in a new thread, @@ -1268,7 +1268,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + This method spins in a loop which reads a field.  The compiler may legally hoist the read out of the loop, turning the code into an infinite loop.  The class should be changed so it uses proper @@ -1277,7 +1277,7 @@ Thus, having a mutable instance field generally creates race conditions.]]> - + This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). In addition, @@ -1300,7 +1300,7 @@ Language Specification
    for details - + This code seems to be using non-short-circuit logic (e.g., & or |) rather than short-circuit logic (&& or ||). @@ -1318,7 +1318,7 @@ Language Specification for details - + Waiting on a monitor while two locks are held may cause deadlock.   @@ -1331,7 +1331,7 @@ This not necessarily a bug, but is worth examining - + This method contains a call to java.lang.Object.wait() which is not guarded by conditional control flow.  The code should verify that condition it intends to wait for is not already satisfied @@ -1341,7 +1341,7 @@ This not necessarily a bug, but is worth examining - + This constructor reads a field which has not yet been assigned a value.  This is often caused when the programmer mistakenly uses the field instead of one of the constructor's parameters.

    ]]>
    @@ -1349,7 +1349,7 @@ This not necessarily a bug, but is worth examining - + This class contains similarly-named get and set methods where the set method is synchronized and the get method is not.  This may result in incorrect behavior at runtime, as callers of the get @@ -1359,7 +1359,7 @@ This not necessarily a bug, but is worth examining - + A circularity was detected in the static initializers of the two classes referenced by the bug instance.  Many kinds of unexpected behavior may arise from such circularity.

    ]]>
    @@ -1367,7 +1367,7 @@ This not necessarily a bug, but is worth examining - + During the initialization of a class, the class makes an active use of a subclass. That subclass will not yet be initialized at the time of this use. For example, in the following code, foo will be null.

    @@ -1385,7 +1385,7 @@ public class CircularClassInitialization { - + This class implements the java.util.Iterator interface.  However, its next() method is not capable of throwing java.util.NoSuchElementException.  The next() @@ -1395,7 +1395,7 @@ public class CircularClassInitialization { - + The code synchronizes on interned String.
     private static String LOCK = "LOCK";
    @@ -1412,7 +1412,7 @@ blocking and deadlock behavior. See 
         
         
    -    
    +    
          The code synchronizes on a boxed primitive constant, such as an Boolean.
     
     private static Boolean inited = Boolean.FALSE;
    @@ -1432,7 +1432,7 @@ and possible deadlock

    ]]> - + The code synchronizes on an apparently unshared boxed primitive, such as an Integer.
    @@ -1457,7 +1457,7 @@ throughout the JVM, leading to very confusing behavior and potential deadlock.
       
         
         
    -    
    +    
          The code synchronizes on a boxed primitive constant, such as an Integer.
     
     private static Integer count = 0;
    @@ -1475,7 +1475,7 @@ and possible deadlock

    ]]> - + The code contains an empty synchronized block:

     synchronized() {}
    @@ -1489,7 +1489,7 @@ than less contrived solutions.
       
         
         
    -    
    +    
          The fields of this class appear to be accessed inconsistently with respect
       to synchronization.  This bug report indicates that the bug pattern detector
       judged that
    @@ -1513,7 +1513,7 @@ than less contrived solutions.
       
         
         
    -    
    +    
          This method synchronizes on a field in what appears to be an attempt
     to guard against simultaneous updates to that field. But guarding a field
     gets a lock on the referenced object, not on the field. This may not 
    @@ -1539,7 +1539,7 @@ private Long getNotificationSequenceNumber() {
       
         
         
    -    
    +    
          This method synchronizes on an object
        referenced from a mutable field.
        This is unlikely to have useful semantics, since different
    @@ -1549,7 +1549,7 @@ threads may be synchronizing on different objects.

    ]]>
    - + A final static field that is defined in an interface references a mutable @@ -1565,7 +1565,7 @@ defined in an interface references a mutable - + A mutable static field could be changed by malicious code or by accident from another package. @@ -1576,7 +1576,7 @@ defined in an interface references a mutable - + A mutable static field could be changed by malicious code or by accident from another package. @@ -1586,7 +1586,7 @@ defined in an interface references a mutable - + A mutable static field could be changed by malicious code or by accident. The field could be made package protected to avoid @@ -1595,7 +1595,7 @@ defined in an interface references a mutable - + A final static field references a Hashtable and can be accessed by malicious code or by accident from another package. @@ -1604,7 +1604,7 @@ defined in an interface references a mutable - + A final static field references an array and can be accessed by malicious code or by accident from another package. @@ -1613,7 +1613,7 @@ defined in an interface references a mutable - + A mutable static field could be changed by malicious code or by accident from another package. @@ -1623,7 +1623,7 @@ defined in an interface references a mutable - + An inner class is invoking a method that could be resolved to either a inherited method or a method defined in an outer class. By the Java semantics, it will be resolved to invoke the inherited method, but this may not be want you intend. If you really intend to invoke the inherited method, @@ -1635,7 +1635,7 @@ that you want to invoke the inherited method, not the method in the outer class. - + This class has a simple name that is identical to that of its superclass, except that its superclass is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements @@ -1646,7 +1646,7 @@ opportunities to accidently define methods that do not override methods in their - + This class/interface has a simple name that is identical to that of an implemented/extended interface, except that the interface is in a different package (e.g., alpha.Foo extends beta.Foo). This can be exceptionally confusing, create lots of situations in which you have to look at import statements @@ -1657,7 +1657,7 @@ opportunities to accidently define methods that do not override methods in their - + The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. @@ -1666,7 +1666,7 @@ identical then one of the methods would override the other. - + The referenced methods have names that differ only by capitalization. This is very confusing because if the capitalization were identical then one of the methods would override the other. From the existence of other methods, it @@ -1678,7 +1678,7 @@ You should try hard to eliminate one of them, unless you are forced to have both - + The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. For example, if you have:

    @@ -1706,7 +1706,7 @@ types are Foo's from different packages. - + The method in the subclass doesn't override a similar method in a superclass because the type of a parameter doesn't exactly match the type of the corresponding parameter in the superclass. For example, if you have:

    @@ -1739,13 +1739,13 @@ removing or deprecating the method with the similar but not identical signature. - + The referenced methods have names that differ only by capitalization.

    ]]>
    - + This regular method has the same name as the class it is defined in. It is likely that this was intended to be a constructor. If it was intended to be a constructor, remove the declaration of a void return value. If you had accidently defined this method, realized the mistake, defined a proper constructor @@ -1755,14 +1755,14 @@ removing or deprecating the method with the similar but not identical signature. - + This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class.

    ]]>
    - + This method ignores the return value of one of the variants of java.io.InputStream.read() which can return multiple bytes.  If the return value is not checked, the caller will not be able to correctly @@ -1774,7 +1774,7 @@ be confusing to users of this class.

    ]]>
    - + This method ignores the return value of java.io.InputStream.skip() which can skip multiple bytes.  If the return value is not checked, the caller will not be able to correctly @@ -1788,7 +1788,7 @@ be confusing to users of this class.

    ]]>
    - + In order for the readResolve method to be recognized by the serialization mechanism, it must not be declared as a static method.

    ]]>
    @@ -1796,7 +1796,7 @@ mechanism, it must not be declared as a static method. - + This class defines a private readResolve method. Since it is private, it won't be inherited by subclasses. This might be intentional and OK, but should be reviewed to ensure it is what is intended.

    ]]>
    @@ -1804,7 +1804,7 @@ This might be intentional and OK, but should be reviewed to ensure it is what is - + In order for the readResolve method to be recognized by the serialization mechanism, it must be declared to have a return type of Object.

    ]]>
    @@ -1812,7 +1812,7 @@ mechanism, it must be declared to have a return type of Object. - + The field is marked as transient, but the class isn't Serializable, so marking it as transient has absolutely no effect. This may be leftover marking from a previous version of the code in which the class was transient, or @@ -1822,7 +1822,7 @@ it may indicate a misunderstanding of how serialization works. - + This class contains a field that is updated at multiple places in the class, thus it seems to be part of the state of the class. However, since the field is marked as transient and not set in readObject or readResolve, it will contain the default value in any deserialized instance of the class.

    ]]>
    @@ -1830,7 +1830,7 @@ deserialized instance of the class. - + This class implements the Serializable interface, and defines a method for custom serialization/deserialization. But since that method isn't declared private, it will be silently ignored by the serialization/deserialization API.

    ]]>
    @@ -1838,7 +1838,7 @@ deserialized instance of the class. - + This class implements the Externalizable interface, but does not define a void constructor. When Externalizable objects are deserialized, they first need to be constructed by invoking the void @@ -1848,7 +1848,7 @@ deserialized instance of the class. - + This class implements the Serializable interface and its superclass does not. When such an object is deserialized, the fields of the superclass need to be initialized by @@ -1859,7 +1859,7 @@ deserialized instance of the class. - + This class implements the Serializable interface, but does not define a serialVersionUID field.  A change as simple as adding a reference to a .class object @@ -1876,7 +1876,7 @@ deserialized instance of the class. - + This class implements the Comparator interface. You should consider whether or not it should also implement the Serializable interface. If a comparator is used to construct an ordered collection @@ -1890,14 +1890,14 @@ 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.

    ]]>
    - + This serializable class defines a readObject() which is synchronized.  By definition, an object created by deserialization is only reachable by one thread, and thus there is no need for @@ -1908,7 +1908,7 @@ is generally easy and good defensive programming. - + This class defines a serialVersionUID field that is not static.  The field should be made static if it is intended to specify @@ -1917,7 +1917,7 @@ is generally easy and good defensive programming. - + This class defines a serialVersionUID field that is not final.  The field should be made final if it is intended to specify @@ -1926,7 +1926,7 @@ is generally easy and good defensive programming. - + This class defines a serialVersionUID field that is not long.  The field should be made long if it is intended to specify @@ -1935,7 +1935,7 @@ is generally easy and good defensive programming. - + This Serializable class is an inner class of a non-serializable class. Thus, attempts to serialize it will also attempt to associate instance of the outer class with which it is associated, leading to a runtime error. @@ -1948,7 +1948,7 @@ of the outer class, which it often not what you really want.]]> - + This Serializable class is an inner class. Any attempt to serialize it will also serialize the associated outer instance. The outer instance is serializable, so this won't fail, but it might serialize a lot more data than intended. @@ -1958,14 +1958,14 @@ problem.]]> - + A non-serializable value is stored into a non-transient field of a serializable class.

    ]]>
    - + The constructor starts a thread. This is likely to be wrong if the class is ever extended/subclassed, since the thread will be started before the subclass constructor is started.

    ]]>
    @@ -1973,7 +1973,7 @@ of a serializable class.

    ]]>
    - + This class contains an instance final field that is initialized to a compile-time static value. Consider making the field static.

    ]]>
    @@ -1981,19 +1981,19 @@ of a serializable class.

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

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

    ]]>
    - + Are you sure this for loop is incrementing the correct variable? It appears that another variable is being initialized and checked by the for loop. @@ -2002,7 +2002,7 @@ of a serializable class.

    ]]>
    - + All writes to this field are of the constant value null, and thus all reads of the field will return null. Check for errors, or remove it if it is useless.

    ]]>
    @@ -2010,7 +2010,7 @@ Check for errors, or remove it if it is useless.

    ]]>
    - + This instance method writes to a static field. This is tricky to get correct if multiple instances are being manipulated, and generally bad practice. @@ -2019,7 +2019,7 @@ and generally bad practice. - + The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the @@ -2029,7 +2029,7 @@ variable is null should have been a check to see if it was nonnull). - + The result of invoking readLine() is dereferenced without checking to see if the result is null. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception.

    ]]>
    @@ -2037,7 +2037,7 @@ to read, readLine() will return null and dereferencing that will generate a null - + The result of invoking readLine() is immediately dereferenced. If there are no more lines of text to read, readLine() will return null and dereferencing that will generate a null pointer exception.

    ]]>
    @@ -2045,7 +2045,7 @@ to read, readLine() will return null and dereferencing that will generate a null - + This class is an inner class, but does not use its embedded reference to the object which created it.  This reference makes the instances of the class larger, and may keep the reference to the creator object @@ -2056,7 +2056,7 @@ to read, readLine() will return null and dereferencing that will generate a null - + This class is an inner class, but does not use its embedded reference to the object which created it.  This reference makes the instances of the class larger, and may keep the reference to the creator object @@ -2068,7 +2068,7 @@ the inner class so that it is a named inner class.

    ]]>
    - + This class is an inner class, but does not use its embedded reference to the object which created it except during construction of the inner object.  This reference makes the instances @@ -2083,7 +2083,7 @@ inner object.  This reference makes the instances - + This method contains a call to java.lang.Object.wait() which is not in a loop.  If the monitor is used for multiple conditions, the condition the caller intended to wait for might not be the one @@ -2092,7 +2092,7 @@ inner object.  This reference makes the instances - + This method contains a call to java.util.concurrent.await() (or variants) which is not in a loop.  If the object is used for multiple conditions, @@ -2102,7 +2102,7 @@ inner object.  This reference makes the instances - + This method calls notify() rather than notifyAll().  Java monitors are often used for multiple conditions.  Calling notify() only wakes up one thread, meaning that the thread woken up might not be the @@ -2111,7 +2111,7 @@ inner object.  This reference makes the instances - + The method invokes String.indexOf and checks to see if the result is positive or non-positive. It is much more typical to check to see if the result is negative or non-negative. It is positive only if the substring checked for occurs at some place other than at the beginning of @@ -2120,7 +2120,7 @@ inner object.  This reference makes the instances - + The value returned by readLine is discarded after checking to see if the return 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.

    ]]>
    @@ -2128,7 +2128,7 @@ to use that non-null value. Calling readLine again will give you a different lin - + The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. For example, in the following code @@ -2153,7 +2153,7 @@ dateString = dateString.trim(); - + This method returns a value that is not checked. The return value should be checked since it can indicate an unusual or unexpected function execution. For example, the File.delete() method returns false @@ -2166,7 +2166,7 @@ signals unexpected behavior by returning an atypical return value. - + This code creates an exception (or error) object, but doesn't do anything with it. For example, something like

    @@ -2186,7 +2186,7 @@ if (x < 0) - + The return value of this method should be checked. One common cause of this warning is to invoke a method on an immutable object, thinking that it updates the object. For example, in the following code @@ -2211,21 +2211,21 @@ dateString = dateString.trim(); - + A null pointer is dereferenced here.  This will lead to a NullPointerException when the code is executed.

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

    ]]>
    - + A pointer which is null on an exception path is dereferenced here.  This will lead to a NullPointerException when the code is executed.  Note that because FindBugs currently does not prune infeasible exception paths, @@ -2237,7 +2237,7 @@ be an exception path, since the default case is often infeasible.

    ]]> - + This parameter is always used in a way that requires it to be nonnull, but the parameter is explicitly annotated as being Nullable. Either the use of the parameter or the annotation is wrong. @@ -2246,7 +2246,7 @@ of the parameter or the annotation is wrong. - + There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. @@ -2257,7 +2257,7 @@ the null pointer exception can't ever be executed; deciding that is beyond the a - + There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. @@ -2269,7 +2269,7 @@ Due to the fact that this value had been previously tested for nullness, this is - + A reference value which is null on some exception control path is dereferenced here.  This may lead to a NullPointerException when the code is executed.  @@ -2282,7 +2282,7 @@ be an exception path, since the default case is often infeasible.

    ]]> - + The return value from a method is dereferenced without a null check, 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. @@ -2291,7 +2291,7 @@ for null. This may lead to a NullPointerException when the code is - + A possibly-null value is passed to a nonnull method parameter. Either the parameter is annotated as a parameter that should @@ -2302,7 +2302,7 @@ for null. This may lead to a NullPointerException when the code is - + A possibly-null value is passed at a call site where all known target methods require the parameter to be nonnull. @@ -2314,7 +2314,7 @@ for null. This may lead to a NullPointerException when the code is - + This method call passes a null value for a nonnull method parameter. Either the parameter is annotated as a parameter that should @@ -2325,7 +2325,7 @@ for null. This may lead to a NullPointerException when the code is - + This method passes a null value as the parameter of a method which must be nonnull. Either this parameter has been explicitly marked @@ -2336,7 +2336,7 @@ for null. This may lead to a NullPointerException when the code is - + This method may return a null value, but the method (or a superclass method which it overrides) is declared to return @NonNull. @@ -2345,7 +2345,7 @@ for null. This may lead to a NullPointerException when the code is - + This clone method seems to return null in some circumstances, but clone is never allowed to return a null value. If you are convinced this path is unreachable, throw an AssertionError @@ -2355,7 +2355,7 @@ for null. This may lead to a NullPointerException when the code is - + This toString method seems to return null in some circumstances. A liberal reading of the spec could be interpreted as allowing this, but it is probably a bad idea and could cause @@ -2365,7 +2365,7 @@ for null. This may lead to a NullPointerException when the code is - + There is a statement or branch that if executed guarantees that a value is null at this point, and that @@ -2376,7 +2376,7 @@ for null. This may lead to a NullPointerException when the code is - + There is a statement or branch on an exception path that if executed guarantees that @@ -2388,14 +2388,14 @@ for null. This may lead to a NullPointerException when the code is - + The class's static initializer creates an instance of the class before all of the static final fields are assigned.

    ]]>
    - + The method creates an IO stream object, does not assign it to any fields, pass it to other methods that might close it, or return it, and does not appear to close @@ -2407,7 +2407,7 @@ closed.

    ]]>
    - + The method creates an IO stream object, does not assign it to any fields, pass it to other methods, or return it, and does not appear to close it on all possible exception paths out of the method.  @@ -2418,7 +2418,7 @@ closed.

    ]]>
    - + It is often a better design to return a length zero array rather than a null reference to indicate that there are no results (i.e., an empty list of results). @@ -2433,7 +2433,7 @@ is not a directory.

    ]]>
    - + This method contains a useless control flow statement, where control flow continues onto the same place regardless of whether or not the branch is taken. For example, @@ -2448,7 +2448,7 @@ block for an if statement:

    - + This method contains a useless control flow statement in which control flow follows to the same or following line regardless of whether or not the branch is taken. @@ -2462,7 +2462,7 @@ body of an if statement, e.g.:

    - + A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. @@ -2473,35 +2473,35 @@ or the previous dereference is erroneous.

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

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

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

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

    ]]>
    - + This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all paths out of the method. In general, the correct idiom for using a JSR-166 lock is: @@ -2519,7 +2519,7 @@ for using a JSR-166 lock is: - + This method acquires a JSR-166 (java.util.concurrent) lock, but does not release it on all exception paths out of the method. In general, the correct idiom for using a JSR-166 lock is: @@ -2537,7 +2537,7 @@ for using a JSR-166 lock is: - + This method compares two reference values using the == or != operator, where the correct way to compare instances of this type is generally with the equals() method. Examples of classes which should generally @@ -2546,7 +2546,7 @@ not be compared by reference are java.lang.Integer, java.lang.Float, etc.

    ]]> - + This method uses using pointer equality to compare two references that seem to be of different types. The result of this comparison will always be false at runtime.

    ]]>
    @@ -2554,7 +2554,7 @@ different types. The result of this comparison will always be false at runtime. - + This method calls equals(Object) on two references of different class types with no common subclasses. Therefore, the objects being compared @@ -2571,7 +2571,7 @@ the result of this comparison will always be false at runtime. - + This method calls equals(Object) on two references of unrelated interface types, where neither is a subtype of the other, and there are no known non-abstract classes which implement both interfaces. @@ -2589,7 +2589,7 @@ the result of this comparison will always be false at runtime. - + This method calls equals(Object) on two references, one of which is a class and the other an interface, where neither the class nor any of its @@ -2608,7 +2608,7 @@ the result of this comparison will always be false at runtime. - + This method calls equals(Object), passing a null value as the argument. According to the contract of the equals() method, this call should always return false.

    ]]>
    @@ -2616,7 +2616,7 @@ this call should always return false.

    ]]>
    - + This method calls Object.wait() without obviously holding a lock on the object.  Calling wait() without a lock held will result in an IllegalMonitorStateException being thrown.

    ]]>
    @@ -2624,7 +2624,7 @@ an IllegalMonitorStateException being thrown.

    ]]>
    - + This method calls Object.notify() or Object.notifyAll() without obviously holding a lock on the object.  Calling notify() or notifyAll() without a lock held will result in an IllegalMonitorStateException being thrown.

    ]]>
    @@ -2632,7 +2632,7 @@ an IllegalMonitorStateException being thrown.

    ]]>
    - + This method contains a self assignment of a local variable; e.g.

       public void foo() {
    @@ -2647,7 +2647,7 @@ Such assignments are useless, and may indicate a logic error or typo.
       
         
         
    -    
    +    
          This method contains a self assignment of a field; e.g.
     

    @@ -2661,7 +2661,7 @@ Such assignments are useless, and may indicate a logic error or typo.
       
         
         
    -    
    +    
          This method contains a double assignment of a field; e.g.
     

    @@ -2675,7 +2675,7 @@ Such assignments are useless, and may indicate a logic error or typo.
       
         
         
    -    
    +    
          This method contains a double assignment of a local variable; e.g.
     

    @@ -2689,7 +2689,7 @@ Such assignments are useless, and may indicate a logic error or typo.
       
         
         
    -    
    +    
          This method performs a nonsensical computation of a field with another
     reference to the same field (e.g., x&x or x-x). Because of the nature
     of the computation, this operation doesn't seem to make sense,
    @@ -2700,7 +2700,7 @@ a logic error.  Double check the computation.
       
         
         
    -    
    +    
          This method performs a nonsensical computation of a local variable with another
     reference to the same variable (e.g., x&x or x-x). Because of the nature
     of the computation, this operation doesn't seem to make sense,
    @@ -2711,7 +2711,7 @@ a logic error.  Double check the computation.
       
         
         
    -    
    +    
          This method compares a field with itself, and may indicate a typo or
     a logic error.  Make sure that you are comparing the right things.
     

    ]]>
    @@ -2719,7 +2719,7 @@ a logic error. Make sure that you are comparing the right things. - + This method compares a local variable with itself, and may indicate a typo or a logic error. Make sure that you are comparing the right things.

    ]]>
    @@ -2727,7 +2727,7 @@ a logic error. Make sure that you are comparing the right things. - + The Double.longBitsToDouble method is invoked, but a 32 bit int value is passed as an argument. This almostly certainly is not intended and is unlikely to give the intended result. @@ -2736,7 +2736,7 @@ a logic error. Make sure that you are comparing the right things. - + This code creates a java.util.Random object, uses it to generate one random number, and then discards the Random object. This produces mediocre quality random numbers and is inefficient. If possible, rewrite the code so that the Random object is created once and saved, and each time a new random number @@ -2751,7 +2751,7 @@ number; the values are too easily guessable. You should strongly consider using - + This code generates a random signed integer and then computes the absolute value of that random integer. If the number returned by the random number generator is Integer.MIN_VALUE, then the result will be negative as well (since @@ -2761,7 +2761,7 @@ generator is Integer.MIN_VALUE, then the result will be negative as - + This code generates a hashcode and then computes the absolute value of that hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since @@ -2771,7 +2771,7 @@ is Integer.MIN_VALUE, then the result will be negative as well (sin - + This code generates a random signed integer and then computes the remainder of that value modulo another value. Since the random number can be negative, the result of the remainder operation @@ -2782,7 +2782,7 @@ consider using the Random.nextInt(int) method instead. - + This code computes a hashCode, and then computes the remainder of that value modulo another value. Since the hashCode can be negative, the result of the remainder operation @@ -2801,14 +2801,14 @@ value of the result of the remainder operation (i.e., use - + This code compares a value that is guaranteed to be non-negative with a negative constant.

    ]]>
    - + Signed bytes can only have a value in the range -128 to 127. Comparing a signed byte with a value outside that range is vacuous and likely to be incorrect. To convert a signed byte b to an unsigned value in the range 0..255, @@ -2818,7 +2818,7 @@ use 0xff & b - + This is an integer bit operation (and, or, or exclusive or) that doesn't do any useful work (e.g., v & 0xffffffff). @@ -2827,7 +2827,7 @@ use 0xff & b - + There is an integer comparison that always returns the same value (e.g., x <= Integer.MAX_VALUE).

    ]]>
    @@ -2835,7 +2835,7 @@ the same value (e.g., x <= Integer.MAX_VALUE). - + Any expression (exp % 1) is guaranteed to always return zero. Did you mean (exp & 1) or (exp % 2) instead?

    ]]>
    @@ -2843,7 +2843,7 @@ Did you mean (exp & 1) or (exp % 2) instead? - + Loads a value from a byte array and performs a bitwise OR with that value. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. @@ -2871,7 +2871,7 @@ for(int i = 0; i < 4; i++) - + Adds a byte value and a value which is known to the 8 lower bits clear. Values loaded from a byte array are sign extended to 32 bits before any any bitwise operations are performed on the value. @@ -2899,7 +2899,7 @@ for(int i = 0; i < 4; i++) - + This method compares an expression of the form (e & C) to D, which will always compare unequal due to the specific values of constants C and D. @@ -2908,7 +2908,7 @@ This may indicate a logic error or typo.

    ]]>
    - + This method compares an expression such as
    ((event.detail & SWT.SELECTED) > 0)
    . Using bit arithmetic and then comparing with the greater than operator can @@ -2924,7 +2924,7 @@ to use '!= 0' instead of '> 0'. - + This method compares an expression such as
    ((event.detail & SWT.SELECTED) > 0)
    . Using bit arithmetic and then comparing with the greater than operator can @@ -2940,7 +2940,7 @@ to use '!= 0' instead of '> 0'. - + This method compares an expression of the form (e & 0) to 0, which will always compare equal. This may indicate a logic error or typo.

    ]]>
    @@ -2948,7 +2948,7 @@ This may indicate a logic error or typo.

    ]]>
    - + This method compares an expression of the form (e | C) to D. which will always compare unequal due to the specific values of constants C and D. @@ -2961,7 +2961,7 @@ operator ("|") instead of bitwise AND ("&").

    ]]>
    - + This method contains an unsynchronized lazy initialization of a non-volatile static field. Because the compiler or processor may reorder instructions, threads are not guaranteed to see a completely initialized object, @@ -2974,7 +2974,7 @@ For more information, see the - + This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further accessed. The setting of the field is visible to other threads as soon as it is set. If the @@ -2986,7 +2986,7 @@ any other thread from accessing the stored object until it is fully initialized. - + This method performs synchronization on an implementation of java.util.concurrent.locks.Lock. You should use the lock() and unlock() methods instead. @@ -2995,7 +2995,7 @@ the lock() and unlock() methods instead. - + This private method is never called. Although it is possible that the method will be invoked through reflection, it is more likely that the method is never used, and should be @@ -3005,7 +3005,7 @@ removed. - + This anonymous class defined a method that is not directly invoked and does not override a method in a superclass. Since methods in other classes cannot directly invoke methods declared in an anonymous class, it seems that this method is uncallable. The method @@ -3017,7 +3017,7 @@ in fact, override the method it is intended to. - + The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close @@ -3030,7 +3030,7 @@ have problems communicating with the database. - + The method creates a database resource (such as a database connection or row set), does not assign it to any fields, pass it to other methods, or return it, and does not appear to close @@ -3042,7 +3042,7 @@ have problems communicating with the database.

    ]]>
    - + The method seems to be building a String using concatenation in a loop. In each iteration, the String is converted to a StringBuffer/StringBuilder, appended to, and converted back to a String. @@ -3071,7 +3071,7 @@ a StringBuffer (or StringBuilder in Java 1.5) explicitly.

    - + This method uses the toArray() method of a collection derived class, and passes in a zero-length prototype array argument. It is more efficient to use myCollection.toArray(new Foo[myCollection.size()]) @@ -3083,7 +3083,7 @@ directly. This avoids the need to create a second array - + A JUnit assertion is performed in a run method. Failed JUnit assertions just result in exceptions being thrown. Thus, if this exception occurs in a thread other than the thread that invokes @@ -3094,28 +3094,28 @@ in the test failing. - + Class is a JUnit TestCase and implements the setUp method. The setUp method should call super.setUp(), but doesn't.

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

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

    ]]>
    - + Class is a JUnit TestCase and defines a suite() method. However, the suite method needs to be declared as either
    public static junit.framework.Test suite()
    @@ -3126,13 +3126,13 @@ or - + Class is a JUnit TestCase but has not implemented any test methods

    ]]>
    - + This method overrides a method found in a parent class, where that class is an Adapter that implements 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.

    ]]>
    @@ -3140,28 +3140,28 @@ get called when the event occurs.

    ]]>
    - + 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.

    ]]>
    - + 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.

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

    ]]>
    - + This method invokes the .equals(Object o) to compare an array and a reference that doesn't seem to be an array. If things being compared are of different types, they are guaranteed to be unequal @@ -3174,7 +3174,7 @@ contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). - + This method invokes the .equals(Object o) method on an array. Since arrays do not override the equals method of Object, calling equals on an array is the same as comparing their addresses. To compare the @@ -3184,7 +3184,7 @@ contents of the arrays, use java.util.Arrays.equals(Object[], Object[]). - + This method invokes the Thread.currentThread() call, just to call the interrupted() method. As interrupted() is a static method, is more simple and clear to use Thread.interrupted(). @@ -3193,7 +3193,7 @@ static method, is more simple and clear to use Thread.interrupted(). - + This method invokes the Thread.interrupted() method on a Thread object that appears to be a Thread object that is not the current thread. As the interrupted() method is static, the interrupted method will be called on a different @@ -3203,7 +3203,7 @@ object than the one the author intended. - + The initial value of this parameter is ignored, and the parameter is overwritten here. This often indicates a mistaken belief that @@ -3214,7 +3214,7 @@ the caller. - + This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. @@ -3230,7 +3230,7 @@ there is no easy way to eliminate these false positives. - + This statement assigns to a local variable in a return statement. This assignment has effect. Please verify that this statement does the right thing. @@ -3239,7 +3239,7 @@ has effect. Please verify that this statement does the right thing. - + This instruction assigns a class literal to a variable and then never uses it. The behavior of this differs in Java 1.4 and in Java 5. @@ -3254,7 +3254,7 @@ for more details and examples, and suggestions on how to force class initializat - + The code stores null into a local variable, and the stored value is not 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. @@ -3263,7 +3263,7 @@ as of Java SE 6.0, this is no longer needed or useful. - + This method defines a local variable with the same name as a field in this class or a superclass. This may cause the method to read an uninitialized value from the field, leave the field uninitialized, @@ -3272,7 +3272,7 @@ or both.

    ]]>
    - + This class defines a field with the same name as a visible instance field in a superclass. This is confusing, and may indicate an error if methods update or access one of @@ -3281,7 +3281,7 @@ the fields when they wanted the other.

    ]]>
    - + This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.

    ]]>
    @@ -3289,14 +3289,14 @@ Map.get(key) lookup.

    ]]>
    - + 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.

    ]]>
    - + This method uses a try-catch block that catches Exception objects, but Exception is not thrown within the try block, and RuntimeException is not explicitly caught. It is a common bug pattern to @@ -3308,7 +3308,7 @@ does not need to be created, just access the static methods directly using the c - + This code checks to see if a floating point value is equal to the special Not A Number value (e.g., if (x == Double.NaN)). However, @@ -3325,7 +3325,7 @@ does not need to be created, just access the static methods directly using the c - + This operation compares two floating point values for equality. Because floating point calculations may involve rounding, @@ -3341,7 +3341,7 @@ does not need to be created, just access the static methods directly using the c - + This method uses a static method from java.lang.Math on a constant value. This method's result in this case, can be determined statically, and is faster and sometimes more accurate to just use the constant. Methods detected are: @@ -3424,7 +3424,7 @@ just use the constant. Methods detected are: - + This class declares that it implements an interface that is also implemented by a superclass. This is redundant because once a superclass implements an interface, all subclasses by default also @@ -3436,7 +3436,7 @@ just use the constant. Methods detected are: - + This class extends from a Struts Action class, and uses an instance member variable. Since only one instance of a struts Action class is created by the Struts framework, and used in a @@ -3448,7 +3448,7 @@ just use the constant. Methods detected are: - + This class extends from a Servlet class, and uses an instance member variable. Since only one instance of a Servlet class is created by the J2EE framework, and used in a @@ -3459,7 +3459,7 @@ just use the constant. Methods detected are: - + This class uses synchronization along with wait(), notify() or notifyAll() on itself (the this reference). Client classes that use this class, may, in addition, use an instance of this class @@ -3471,7 +3471,7 @@ just use the constant. Methods detected are: - + This code performs integer multiply and then converts the result to a long, as in: @@ -3497,7 +3497,7 @@ or - + This code converts an int value to a float precision floating point number and then @@ -3512,7 +3512,7 @@ floating point arithmetic. - + This code converts an int value to a double precision floating point number and then @@ -3527,7 +3527,7 @@ floating point arithmetic. - + This code casts the result of an integer division operation to double or float. @@ -3552,7 +3552,7 @@ double value2 = x / (double) y; - + This code seems to be storing a non-serializable object into an HttpSession. If this session is passivated or migrated, an error will result. @@ -3561,7 +3561,7 @@ If this session is passivated or migrated, an error will result. - + This code seems to be passing a non-serializable object to the ObjectOutput.writeObject method. If the object is, indeed, non-serializable, an error will result. @@ -3570,7 +3570,7 @@ If the object is, indeed, non-serializable, an error will result. - + The format string specifies a relative index to request that the argument for the previous format specifier be reused. However, there is no previous argument. @@ -3584,7 +3584,7 @@ For example, - + One of the arguments is uncompatible with the corresponding format string specifier. As a result, this will generate a runtime exception when executed. @@ -3595,7 +3595,7 @@ the String "1" is incompatible with the format specifier %d. - + An argument not of type Boolean is being formatted with a %b format specifier. This won't throw an exception; instead, it will print true for any nonnull value, and false for null. @@ -3605,7 +3605,7 @@ This feature of format strings is strange, and may not be what you intended. - + One of the arguments being formatted with a format string is an array. This will be formatted using a fairly useless format, such as [I@304282, which doesn't actually show the contents @@ -3617,7 +3617,7 @@ Consider wrapping the array using Arrays.asList(...) before handlin - + A format-string method with a variable number of arguments is called, but the number of arguments passed does not match with the number of @@ -3628,7 +3628,7 @@ author intended. - + A format-string method with a variable number of arguments is called, but more arguments are passed than are actually used by the format string. @@ -3639,7 +3639,7 @@ information that was intended to be included in the formatted string. - + The format string is syntactically invalid, and a runtime exception will occur when @@ -3649,7 +3649,7 @@ this statement is executed. - + Not enough arguments are passed to satisfy a placeholder in the format string. A runtime exception will occur when @@ -3659,7 +3659,7 @@ this statement is executed. - + The format string placeholder is incompatible with the corresponding argument. For example, @@ -3676,7 +3676,7 @@ this statement is executed. - + This code passes a primitive array to a function that takes a variable number of object arguments. This creates an array of length one to hold the primitive array and passes it to the function. @@ -3685,7 +3685,7 @@ This creates an array of length one to hold the primitive array and passes it to - + The equals(Object o) method shouldn't make any assumptions about the type of o. It should simply return @@ -3695,7 +3695,7 @@ false if o is not the same type as this. - + This code casts a Collection to an abstract collection (such as List, Set, or Map). @@ -3707,7 +3707,7 @@ to iterate through a collection, you don't need to cast it to a Set or List. - + This cast will always throw a ClassCastException.

    ]]>
    @@ -3715,7 +3715,7 @@ This cast will always throw a ClassCastException. - + This instanceof test will always return false, since the value being checked is guaranteed to be null. Although this is safe, make sure it isn't @@ -3725,7 +3725,7 @@ an indication of some misunderstanding or some other logic error. - + This instanceof test will always return false. Although this is safe, make sure it isn't an indication of some misunderstanding or some other logic error. @@ -3734,7 +3734,7 @@ an indication of some misunderstanding or some other logic error. - + This instanceof test will always return true (unless the value being tested is null). Although this is safe, make sure it isn't @@ -3746,7 +3746,7 @@ better to do a null test rather than an instanceof test. - + This cast is unchecked, and not all instances of the type casted from can be cast to the type it is being cast to. Ensure that your program logic ensures that this @@ -3756,7 +3756,7 @@ cast will not fail. - + This code casts an abstract collection (such as a Collection, List, or Set) to a specific concrete implementation (such as an ArrayList or HashSet). @@ -3769,7 +3769,7 @@ collection class. - + A String function is being invoked and "." is being passed to a parameter that takes a regular expression as an argument. Is this what you intended? @@ -3781,7 +3781,7 @@ character has been replaced by a / character. - + The code here uses a regular expression that is invalid according to the syntax for regular expressions. This statement will throw a PatternSyntaxException when @@ -3791,7 +3791,7 @@ executed. - + The code here uses File.separator where a regular expression is required. This will fail on Windows @@ -3805,7 +3805,7 @@ regular expression as an escape character. Amoung other options, you can just us - + The code performs an increment operation (e.g., i++) and then immediately overwrites it. For example, i = i++ immediately @@ -3815,7 +3815,7 @@ overwrites the incremented value with the original value. - + The code performs an unsigned right shift, whose result is then cast to a short or byte, which discards the upper bits of the result. @@ -3826,7 +3826,7 @@ a signed and unsigned right shift (depending upon the size of the shift). - + The code performs an integer shift by a constant amount outside the range 0..31. @@ -3838,7 +3838,7 @@ and it at least confusing. - + The code multiplies the result of an integer remaining by an integer constant. Be sure you don't have your operator precedence confused. For example @@ -3848,7 +3848,7 @@ i % 60 * 1000 is (i % 60) * 1000, not i % (60 * 1000). - + The code invokes hashCode on an array. Calling hashCode on an array returns the same value as System.identityHashCode, and ingores @@ -3861,7 +3861,7 @@ use java.util.Arrays.hashCode(a). - + The code invokes toString on an array, which will generate a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable @@ -3871,7 +3871,7 @@ String that gives the contents of the array. See Programming Puzzlers, chapter 3 - + The code invokes toString on an (anonymous) array. Calling toString on an array generates a fairly useless result such as [C@16f0472. Consider using Arrays.toString to convert the array into a readable @@ -3881,7 +3881,7 @@ String that gives the contents of the array. See Programming Puzzlers, chapter 3 - + The code computes the average of two integers using either division or signed right shift, and then uses the result as the index of an array. If the values being averaged are very large, this can overflow (resulting in the computation @@ -3899,7 +3899,7 @@ publicized the bug pattern
    . - + The code uses x % 2 == 1 to check to see if a value is odd, but this won't work for negative numbers (e.g., (-5) % 2 == -1). If this code is intending to check @@ -3909,7 +3909,7 @@ for oddness, consider using x & 1 == 1, or x % 2 != 0. - + This code constructs a File object using a hard coded to an absolute pathname (e.g., new File("/home/dannyc/workspace/j2ee/src/share/com/sun/enterprise/deployment");

    ]]>
    @@ -3917,7 +3917,7 @@ for oddness, consider using x & 1 == 1, or x % 2 != 0. - + This code passes a constant month value outside the expected range of 0..11 to a method. @@ -3926,7 +3926,7 @@ value outside the expected range of 0..11 to a method. - + This code invokes substring(0) on a String, which returns the original value.

    ]]>
    @@ -3934,7 +3934,7 @@ This code invokes substring(0) on a String, which returns the original value. - + The hasNext() method invokes the next() method. This is almost certainly wrong, since the hasNext() method is not supposed to change the state of the iterator, @@ -3944,7 +3944,7 @@ and the next method is supposed to change the state of the iterator. - + This method calls Thread.sleep() with a lock held. This may result in very poor performance and scalability, or a deadlock, since other threads may @@ -3956,7 +3956,7 @@ and the next method is supposed to change the state of the iterator. - + This method uses the same code to implement two branches of a conditional branch. Check to ensure that this isn't a coding mistake. @@ -3965,7 +3965,7 @@ and the next method is supposed to change the state of the iterator. - + This method uses the same code to implement two clauses of a switch statement. This could be a case of duplicate code, but it might also indicate @@ -3975,7 +3975,7 @@ and the next method is supposed to change the state of the iterator. - + This method allocates a specific implementation of an xml interface. It is preferable to use the supplied factory classes to create these objects so that the implementation can be @@ -3992,7 +3992,7 @@ and the next method is supposed to change the state of the iterator. - + This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access @@ -4003,7 +4003,7 @@ and the next method is supposed to change the state of the iterator. - + This method assigns a literal boolean value (true or false) to a boolean variable inside an if or while expression. Most probably this was supposed to be a boolean comparison using @@ -4013,7 +4013,7 @@ and the next method is supposed to change the state of the iterator. - + This call to a generic collection method passes an argument while compile type Object where a specific type from the generic type parameters is expected. @@ -4025,7 +4025,7 @@ and the next method is supposed to change the state of the iterator. - + This call to a generic collection method contains an argument with an incompatible class from that of the collection's parameter (i.e., the type of the argument is neither a supertype nor a subtype @@ -4053,7 +4053,7 @@ and the next method is supposed to change the state of the iterator. - + This call to a generic collection's method would only make sense if a collection contained itself (e.g., if s.contains(s) were true). This is unlikely to be true and would cause problems if it were true (such as the computation of the hash code resulting in infinite recursion). @@ -4063,7 +4063,7 @@ It is likely that the wrong value is being passed as a parameter. - + This call doesn't make sense. For any collection c, calling c.containsAll(c) should always be true, and c.retainAll(c) should have no effect.

    ]]>
    @@ -4071,7 +4071,7 @@ always be true, and c.retainAll(c) should have no effect. - + If you want to remove all elements from a collection c, use c.clear, not c.removeAll(c).

    ]]>
    @@ -4079,7 +4079,7 @@ not c.removeAll(c). - + Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application. Under 1.4 problems seem to surface less often than under Java 5 where you will probably see @@ -4092,7 +4092,7 @@ and Sun Bug - + Even though the JavaDoc does not contain a hint about it, Calendars are inherently unsafe for multihtreaded use. The detector has found a call to an instance of Calendar that has been obtained via a static field. This looks suspicous.

    @@ -4102,7 +4102,7 @@ and
    Sun Bug - + As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. Sharing a single instance across thread boundaries without proper synchronization will result in erratic behavior of the application.

    @@ -4114,7 +4114,7 @@ and
    Sun Bug - + As the JavaDoc states, DateFormats are inherently unsafe for multithreaded use. The detector has found a call to an instance of DateFormat that has been obtained via a static field. This looks suspicous.

    @@ -4125,7 +4125,7 @@ and
    Sun Bug - + A value specified as carrying a type qualifier annotation is consumed in a location or locations requiring that the value not @@ -4156,7 +4156,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value specified as not carrying a type qualifier annotation is guaranteed to be consumed in a location or locations requiring that the value does @@ -4176,7 +4176,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value that is annotated as possibility not being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used @@ -4187,7 +4187,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value that is annotated as possibility being an instance of the values denoted by the type qualifier, and the value is guaranteed to be used @@ -4197,7 +4197,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value is used in a way that requires it to be never be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is prohibited from having that type qualifier. @@ -4207,7 +4207,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value is used in a way that requires it to be always be a value denoted by a type qualifier, but there is an explicit annotation stating that it is not known where the value is required to have that type qualifier. @@ -4217,7 +4217,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This code opens a file in append mode and then wraps the result in an object output stream. This won't allow you to append to an existing object output stream stored in a file. If you want to be @@ -4235,7 +4235,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This instance method synchronizes on this.getClass(). If this class is subclassed, subclasses will synchronize on the class object for the subclass, which isn't likely what was intended. @@ -4266,7 +4266,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This method contains a switch statement where one case branch will fall through to the next case. Usually you need to end this case with a break or return. @@ -4276,7 +4276,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This method contains a switch statement where default case is missing. Usually you need to provide a default case. @@ -4286,7 +4286,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value stored in the previous switch case is overwritten here due to a switch fall through. It is likely that you forgot to put a @@ -4297,7 +4297,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + A value stored in the previous switch case is ignored here due to a switch fall through to a place where an exception is thrown. It is likely that you forgot to put a break or return at the end of the previous case. @@ -4307,7 +4307,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations @@ -4318,7 +4318,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + Names of fields that are not final should be in mixed case with a lowercase first letter and the first letters of subsequent words capitalized. @@ -4328,7 +4328,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. @@ -4338,7 +4338,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This Serializable class defines a non-primitive instance field which is neither transient, Serializable, or java.lang.Object, and does not appear to implement the Externalizable @@ -4350,7 +4350,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This class defines a method equal(Object). This method does not override the equals(Object) method @@ -4361,7 +4361,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This class defines a method called hashcode(). This method does not override the hashCode() @@ -4372,7 +4372,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This class defines a method called tostring(). This method does not override the toString() @@ -4383,7 +4383,7 @@ public @NonNegative Integer example(@Negative Integer value) { - + This class defines a method called tostring(). This method does not override the toString() 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 bb48e02abef..c8d5c5fa473 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 @@ -3,7 +3,7 @@ rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException - + @@ -23,7 +23,7 @@ public class Foo { rulesets/android.xml/CallSuperFirst - + @@ -39,7 +39,7 @@ public class DummyActivity extends Activity { rulesets/android.xml/CallSuperLast - + @@ -55,7 +55,7 @@ public class DummyActivity extends Activity { rulesets/android.xml/ProtectLogD - + @@ -74,7 +74,7 @@ public class DummyActivity extends Activity { rulesets/android.xml/ProtectLogV - + @@ -94,7 +94,7 @@ public class DummyActivity extends Activity { rulesets/basic.xml/EmptyInitializer - + @@ -115,7 +115,7 @@ public class Foo { rulesets/codesize.xml/CyclomaticComplexity - + @@ -136,7 +136,7 @@ public class Foo { rulesets/strings.xml/AvoidStringBufferField - + @@ -149,7 +149,7 @@ class Foo { - + public class Foo @@ -176,7 +176,7 @@ public class Foo - + @@ -188,7 +188,7 @@ public class Foo - + public class Example @@ -214,7 +214,7 @@ public class Example - + // With a minimumNumberCaseForASwitch of 3 @@ -240,7 +240,7 @@ public class Foo { - + public class abstract Example { @@ -255,7 +255,7 @@ public class abstract Example { - + @@ -282,7 +282,7 @@ public class abstract Example { - + @@ -310,7 +310,7 @@ int j = -~7; - + More details. Example :
    @@ -333,7 +333,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -353,7 +353,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -377,7 +377,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -395,7 +395,7 @@ public class Bar {
       
         
         
    -    
    +    
         
           
    @@ -414,7 +414,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -437,7 +437,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -450,7 +450,7 @@ public class Foo {  //Should be final
       
         
         
    -    
    +    
         
           
    @@ -465,7 +465,7 @@ public class MyClass {
       
         
         
    -    
    +    
         
           
    @@ -480,7 +480,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -514,7 +514,7 @@ public class Foo {
       
         
         
    -    
    +    
         
           
    @@ -527,7 +527,7 @@ public class Foo {}
       
         
         
    -    
    +    
         
           
    @@ -544,7 +544,7 @@ public class Bar {
       
         
         
    -    
    +    
         
           
    @@ -556,7 +556,7 @@ public abstract class Foo { // should be AbstractFoo
       
         
         
    -    
    +    
         
           
    @@ -570,7 +570,7 @@ public class ClassInDefaultPackage {
       
         
         
    -    
    +    
         
           
    @@ -583,7 +583,7 @@ public class SomeClass {
       
         
         
    -    
    +
         
           
    @@ -597,7 +597,7 @@ Byte.valueOf(0);
       
         
         
    -    
    +
         
           
    @@ -612,7 +612,7 @@ Short.valueOf(0);
       
         
         
    -    
    +
         
           
    @@ -626,7 +626,7 @@ Long.valueOf(0);
       
         
         
    -    
    +
         
           
    @@ -648,153 +648,153 @@ class Foo{
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +
         
           
       
       
         
         
    -    
    +    
         
           
         
    @@ -810,7 +810,7 @@ class Foo{
       
         
         
    -    
    +    
         
           
         
    @@ -821,7 +821,7 @@ class Foo{
       
         
         
    -    
    +    
         
           
         
    @@ -832,68 +832,68 @@ class Foo{
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
           
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
         
    @@ -904,38 +904,38 @@ class Foo{
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         Example : 
         
    @@ -952,101 +952,101 @@ public class JumbledIncrementerRule1 {
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
           
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +
         
           
       
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +
         
           
       
       
         
         
    -    
    +    
         
         
           
    @@ -1110,13 +1110,13 @@ if (object1!=null && object2.equals(object1)) {
       
         
         
    -    
    +    
         
       
       
         
         
    -    
    +    
         
           
         
    @@ -1127,7 +1127,7 @@ if (object1!=null && object2.equals(object1)) {
       
         
         
    -    
    +    
         
           
         
         
    -    
    +    
         
           
       
       
         
         
    -    
    +
         
       
       
         
         
    -    
    +    
         
     Connection c = openConnection();
    @@ -1194,155 +1194,155 @@ try {
       
         
         
    -    
    +    
         
           public class MyClass {
    // this block gets run before any call to a constructor {
    System.out.println("I am about to construct myself");
    }
    }
    ]]>
    - + - + - + - + - + - + Class c = new String().getClass(); with Class c = String.class;]]> - + int x = 2;
    x = x;
    ]]>
    - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1357,14 +1357,14 @@ try { - + - + @@ -1375,93 +1375,93 @@ try { - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1472,20 +1472,20 @@ try { - + - + - + public class Foo { @@ -1519,44 +1519,44 @@ public class Foo { - + - + - + - + - + - + - + @@ -1566,39 +1566,39 @@ public class Foo { - + - + - + - + - + - + @@ -1609,7 +1609,7 @@ public class Foo { - + @@ -1620,7 +1620,7 @@ public class Foo { - + @@ -1631,7 +1631,7 @@ public class Foo { - + @@ -1642,7 +1642,7 @@ public class Foo { - + @@ -1653,7 +1653,7 @@ public class Foo { - + @@ -1663,7 +1663,7 @@ public class Foo { - + @@ -1673,7 +1673,7 @@ public class Foo { - + @@ -1683,37 +1683,37 @@ public class Foo { - + - + - + - + - + - + @@ -1724,13 +1724,13 @@ public class Foo { - + - + @@ -1740,7 +1740,7 @@ public class Foo { - + public class ShortMethod { @@ -1752,7 +1752,7 @@ public class ShortMethod { - + @@ -1775,7 +1775,7 @@ public class ShortMethod { rulesets/naming.xml/MethodNamingConventions - + @@ -1787,19 +1787,19 @@ public class Foo { - + - + - + public class MyClass { @@ -1813,7 +1813,7 @@ public class MyClass { - + public class Foo { @@ -1825,7 +1825,7 @@ public class Foo { - + public class Foo { @@ -1839,7 +1839,7 @@ public class Foo { - + @@ -1856,7 +1856,7 @@ public class Foo { - + @@ -1869,7 +1869,7 @@ public class Foo extends Bar { - + @@ -1884,7 +1884,7 @@ public class Foo { - + public class Foo { @@ -1898,91 +1898,91 @@ public class Foo { - + - + - + - + - + - + - + - + - + - + - + - + - + - + for (int i=0; i<42;i++) foo();
    ]]> - + @@ -1992,42 +1992,42 @@ public class Foo { - + - + - + - + - + - + @@ -2048,7 +2048,7 @@ public abstract class ShouldBeAbstract - + @@ -2059,74 +2059,74 @@ public abstract class ShouldBeAbstract - + - + - + - + - + - + - + - + - + - + - + - + @@ -2136,7 +2136,7 @@ public abstract class ShouldBeAbstract - + MULTIPLE