mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
28 lines
1.0 KiB
HTML
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>-><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> |