Files
openide/java/java-impl/resources/inspectionDescriptions/ImplicitNumericConversion.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

28 lines
1.0 KiB
HTML

<html>
<body>
Reports implicit conversion between numeric types.
<p>Implicit numeric conversion is not a problem in itself but, if unexpected, may cause difficulties when tracing bugs.</p>
<p><b>Example:</b></p>
<pre><code>
double m(int i) {
return i * 10;
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
double m(int i) {
return (double) (i * 10);
}
</code></pre>
<!-- tooltip end -->
<p>Configure the inspection:</p>
<ul>
<li>Use the <b>Ignore widening conversions</b> option to ignore implicit conversion that cannot result in data loss
(for example, <code>int</code>-&gt;<code>long</code>).</li>
<li>Use the <b>Ignore conversions from and to 'char'</b> option to ignore conversion from and to <code>char</code>. The inspection will
still report conversion from and to floating-point numbers.</li>
<li>Use the <b>Ignore conversion from constants and literals</b> to make the inspection ignore conversion from literals and
compile-time constants.</li>
</ul>
</body>
</html>