From d3cb0dd34ef47231d27b54cb988fbc78aa5e58bb Mon Sep 17 00:00:00 2001 From: "PMD CI (pmd-bot)" Date: Sat, 8 May 2021 18:20:03 +0000 Subject: [PATCH] Update documentation https://github.com/pmd/pmd/actions/runs/823567339 https://github.com/pmd/pmd/compare/03cb11660e11...8208dc9cd662 --- feed.xml | 4 ++-- pmd_release_notes.html | 12 ++++++++++++ pmd_rules_java.html | 4 ++-- pmd_rules_java_bestpractices.html | 11 +++++++---- pmd_rules_java_errorprone.html | 8 ++++---- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/feed.xml b/feed.xml index c589ffd85c..922d5fb4ba 100644 --- a/feed.xml +++ b/feed.xml @@ -5,8 +5,8 @@ Intended as a documentation theme based on Jekyll for technical writers documenting software and other technical products, this theme has all the elements you would need to handle multiple products with both multi-level sidebar navigation, tags, and other documentation features. https://pmd.github.io/pmd/ - Sat, 08 May 2021 17:11:38 +0000 - Sat, 08 May 2021 17:11:38 +0000 + Sat, 08 May 2021 18:16:56 +0000 + Sat, 08 May 2021 18:16:56 +0000 Jekyll v3.9.0 diff --git a/pmd_release_notes.html b/pmd_release_notes.html index 8faf05f64d..9da5cf5641 100644 --- a/pmd_release_notes.html +++ b/pmd_release_notes.html @@ -1449,6 +1449,17 @@ are compared. Constants are identified by looking for an all-caps identifier.#3230: [doc] Remove “Edit me” button for language index pages +
  • dist +
      +
    • #2466: [dist] Distribution archive doesn’t include all batch scripts
    • +
    +
  • +
  • java-bestpractices +
      +
    • #2737: [java] Fix misleading rule message on rule SwitchStmtsShouldHaveDefault with non-exhaustive enum switch
    • +
    • #3236: [java] LiteralsFirstInComparisons should consider constant fields (cont’d)
    • +
    +
  • java-codestyle
    • #2655: [java] UnnecessaryImport false positive for on-demand imports
    • @@ -1459,6 +1470,7 @@ are compared. Constants are identified by looking for an all-caps identifier.
    • java-errorprone
        +
      • #3248: [java] Documentation is wrong for SingletonClassReturningNewInstance rule
      • #3110: [java] Enhance CompareObjectsWithEquals with list of exceptions
      • #3205: [java] Make CompareObjectWithEquals allow comparing against constants
      diff --git a/pmd_rules_java.html b/pmd_rules_java.html index f19c80e80a..c05fe3e5b1 100644 --- a/pmd_rules_java.html +++ b/pmd_rules_java.html @@ -1465,7 +1465,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
    • ReplaceEnumerationWithIterator: Consider replacing Enumeration usages with the newer java.util.Iterator
    • ReplaceHashtableWithMap: Consider replacing Hashtable usage with the newer java.util.Map if thread safety is not required.
    • ReplaceVectorWithList: Consider replacing Vector usages with the newer java.util.ArrayList if expensive thread-safe oper…
    • -
    • SwitchStmtsShouldHaveDefault: All switch statements should include a default option to catch any unspecified values.
    • +
    • SwitchStmtsShouldHaveDefault: Switch statements should be exhaustive, to make their control flow easier to follow. …
    • SystemPrintln: References to System.(out|err).print are usually intended for debugging purposes and can remain …
    • UnusedAssignment: Reports assignments to variables that are never used before the variable is overwritten, …
    • UnusedFormalParameter: Reports parameters of methods and constructors that are not referenced them in the method body. P…
    • @@ -1706,7 +1706,7 @@ $('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2,h3
    • ReturnFromFinallyBlock: Avoid returning from a finally block, this can discard exceptions.
    • SimpleDateFormatNeedsLocale: Be sure to specify a Locale when creating SimpleDateFormat instances to ensure that locale-approp…
    • SingleMethodSingleton: Some classes contain overloaded getInstance. The problem with overloaded getInstance methods is t…
    • -
    • SingletonClassReturningNewInstance: Some classes contain overloaded getInstance. The problem with overloaded getInstance methods is t…
    • +
    • SingletonClassReturningNewInstance: A singleton class should only ever have one instance. Failure to check whether an ins…
    • StaticEJBFieldShouldBeFinal: According to the J2EE specification, an EJB should not have any static fields with write access. …
    • StringBufferInstantiationWithChar: Individual character values provided as initialization arguments will be converted into integers….
    • SuspiciousEqualsMethodName: The method name and parameter number are suspiciously close to ‘Object.equals’, which can denote …
    • diff --git a/pmd_rules_java_bestpractices.html b/pmd_rules_java_bestpractices.html index fde6aca3fc..78224662e7 100644 --- a/pmd_rules_java_bestpractices.html +++ b/pmd_rules_java_bestpractices.html @@ -2927,7 +2927,10 @@ effectively.

      Priority: Medium (3)

      -

      All switch statements should include a default option to catch any unspecified values.

      +

      Switch statements should be exhaustive, to make their control flow +easier to follow. This can be achieved by adding a default case, or, +if the switch is on an enum type, by ensuring there is one switch branch +for each enum constant.

      This rule is defined by the following XPath expression:

      //SwitchStatement[@DefaultCase = false() and @ExhaustiveEnumSwitch = false()]
      @@ -2935,14 +2938,14 @@ effectively.

      Example(s):

      -
      public void bar() {
      +
      class Foo {{
           int x = 2;
           switch (x) {
             case 1: int j = 6;
             case 2: int j = 8;
      -          // missing default: here
      +      // missing default: here
           }
      -}
      +}}
       

      Use this rule by referencing it:

      diff --git a/pmd_rules_java_errorprone.html b/pmd_rules_java_errorprone.html index b649521d4d..756133e430 100644 --- a/pmd_rules_java_errorprone.html +++ b/pmd_rules_java_errorprone.html @@ -4633,9 +4633,9 @@ for each call and new objects will be created for every invocation.

      Priority: Medium High (2)

      -

      Some classes contain overloaded getInstance. The problem with overloaded getInstance methods -is that the instance created using the overloaded method is not cached and so, -for each call and new objects will be created for every invocation.

      +

      A singleton class should only ever have one instance. Failure to check +whether an instance has already been created may result in multiple +instances being created.

      This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.errorprone.SingletonClassReturningNewInstanceRule

      @@ -4645,7 +4645,7 @@ for each call and new objects will be created for every invocation.

      private static Singleton instance = null; public static Singleton getInstance() { synchronized(Singleton.class) { - return new Singleton(); + return new Singleton(); // this should be assigned to the field } } }