diff --git a/java/java-impl/src/inspectionDescriptions/UnnecessaryToStringCall.html b/java/java-impl/src/inspectionDescriptions/UnnecessaryToStringCall.html index 16e602db3e4f..37293aa53512 100644 --- a/java/java-impl/src/inspectionDescriptions/UnnecessaryToStringCall.html +++ b/java/java-impl/src/inspectionDescriptions/UnnecessaryToStringCall.html @@ -7,7 +7,9 @@ Reports calls to toString() that are used in the following cases:
  • In the methods of java.io.PrintWriter or java.io.PrintStream
  • in the methods org.slf4j.Logger
  • -

    In these cases, conversion to string will be handled by the underlying library methods, and the explicit call to toString() is not needed.

    +

    In these cases, conversion to string will be handled by the underlying library methods, + and the explicit call to toString() is not needed. + Removing redundant toString() calls can occasionally even improve performance and reduce object allocations

    Example:

    
       System.out.println(this.toString())
    @@ -21,6 +23,8 @@ Reports calls to toString() that are used in the following cases:
       Note that without the toString() call, the code semantics might be different: if the expression is null,
       then the null string will be used instead of throwing a NullPointerException.

    Use the Report only when qualifier is known to be not-null option to avoid warnings for the values that could potentially be null. + Removing the explicit toString() in these cases will change the runtime semantics + from throwing a NullPointException to silently accepting the value when it is null.

    \ No newline at end of file