Skip to content

Commit

Permalink
Java: further description update (IJPF-CR-10997)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 26b1d01e4f386e296adf1377d73fc6ffe41e3a65
  • Loading branch information
BasLeijdekkers authored and intellij-monorepo-bot committed Jul 19, 2023
1 parent 4923f81 commit 76efbe8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<body>
Reports unnecessary calls to static methods that convert to string, like <code>String.valueOf()</code> or <code>Integer.toString()</code>.
Such calls are unnecessary when used, in string concatenations or, as arguments of library methods where explicit string conversion is not needed.
Reports unnecessary calls to static methods that convert their parameters to a string, e.g. <code>String.valueOf()</code> or <code>Integer.toString()</code>.
Such calls are unnecessary when used in string concatenations.
<p>Example:</p>
<pre><code>
System.out.println("Number: " + Integer.toString(count));
Expand All @@ -10,8 +10,8 @@
<pre><code>
System.out.println("Number: " + count);
</code></pre>
<!-- tooltip end -->
<p>Library methods that don't require explicit string conversion:</p>
Additionally such calls are unnecessary when used as arguments to library methods that do their own string conversion.
Some examples of library methods that do their own string conversion are:
<ul>
<li>
Classes <code>java.io.PrintWriter</code>, <code>java.io.PrintStream</code>
Expand All @@ -29,6 +29,7 @@
</ul>
</li>
</ul>
<!-- tooltip end -->
<p>
Use the <b>Report calls that can be replaced with a concatenation with the empty string</b>
option to also report cases where concatenations with the empty string can be used instead of a call to <code>String.valueOf()</code>.
Expand Down

0 comments on commit 76efbe8

Please sign in to comment.