Java: update inspection descriptions

GitOrigin-RevId: 829a5e8f0b97a4e21dbb1f7d99ba70b777d1240f
This commit is contained in:
Bas Leijdekkers
2025-04-12 16:28:13 +00:00
committed by intellij-monorepo-bot
parent e24bcbd00c
commit fdde91f28d
5 changed files with 41 additions and 14 deletions
@@ -1,7 +1,9 @@
<html>
<body>
Reports non-Basic Latin characters in literals and suggests replacing them with unicode entities.
<p>Example:</p>
Reports non-Basic Latin characters in literals and comments.
The inspection provides a fix to replace such characters with Unicode escapes in literals,
and with HTML entities in comments.
<p><b>Example:</b></p>
<pre><code>
// © 2021
char c = '©';
@@ -14,5 +16,7 @@ Reports non-Basic Latin characters in literals and suggests replacing them with
char c = '\u00a9';
String s = "\u00c1\u00ee";
</code></pre>
<!-- tooltip end -->
By default, this inspection does not highlight in the editor, but only provides a fix.
</body>
</html>
@@ -1,10 +1,9 @@
<html>
<body>
Reports any calls to a variable arity method where the call has a primitive array in
the variable arity parameter position (for example, <code>System.out.printf("%s", new int[]{1, 2, 3})</code>).
Such a primitive-array argument may be confusing, as it will be wrapped as a single-element array, rather than each individual
element being boxed, as might be expected.
<!-- tooltip end -->
Reports any calls to a variable arity method where the call has one primitive-type array in
the variable arity parameter position.
Such a primitive-array argument may be confusing, as it will be wrapped in a single-element array argument, rather than each
element being a separate argument, as may be expected.
<p><b>Example:</b></p>
<pre><code>
String.format("%s", new int[]{1, 2, 3});
@@ -13,5 +12,6 @@ element being boxed, as might be expected.
<pre><code>
String.format("%s", (Object) new int[]{1, 2, 3});
</code></pre>
<!-- tooltip end -->
</body>
</html>
@@ -1,16 +1,21 @@
<html>
<body>
Reports unnecessary cast expressions.
<p>Example:</p>
<p><b>Example:</b></p>
<pre><code>
static Object toObject(String s) {
return (Object) s;
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
static Object toObject(String s) {
return s;
}
</code></pre>
<!-- tooltip end -->
<p>
Use the checkbox below to ignore clarifying casts e.g., casts in collection calls where <code>Object</code> is expected:
Use the checkbox below to ignore clarifying casts, for example casts in collection calls where <code>Object</code> is expected:
<pre><code>
static void removeFromList(List&lt;String&gt; l, Object o) {
l.remove((String)o);
@@ -2,6 +2,23 @@
<body>
Reports text blocks with trailing whitespace characters.
Trailing whitespace is considered incidental and will be stripped away by the Java compiler.
<p><b>Example (where spaces are indicated with dots):</b></p>
<pre><code>
..String.count.=."""
....one
....two....
....three
....""";
</code></pre>
<p>Two quick-fixes are provided.
One to remove the trailing whitespace, and one to escape the trailing whitespace so that it will not be removed by the compiler:</p>
<pre><code>
..String.count.=."""
....one
....two...\s
....three
....""";
</code></pre>
<!-- tooltip end -->
<p><small>New in 2021.1</small></p>
</body>
@@ -1,7 +1,9 @@
<html>
<body>
Reports unnecessarily escaped characters in <code>String</code> and optionally <code>char</code> literals.
<p>Escaped tab characters <code>\t</code> are not reported, because tab characters are invisible.</p>
Reports unnecessarily escaped characters in <code>String</code> literals,
and optionally <code>char</code> literals.
<p>Escaped tab characters (<code>\t</code>) are not reported, even though escaping them is not required,
because tab characters are hard to tell apart from spaces.</p>
<p>Examples:</p>
<pre><code>
String s = "\'Scare\' quotes";
@@ -14,9 +16,8 @@ Reports unnecessarily escaped characters in <code>String</code> and optionally <
String t = """
All you need is
\tLove
""";
""";
</code></pre>
<!-- tooltip end -->
<p><small>New in 2019.3</small>
</body>
</html>