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

18 lines
853 B
HTML

<html>
<body>
Reports explicit boxing, that is wrapping of primitive values in objects.
<p>Explicit manual boxing is unnecessary as of Java 5 and later, and can safely be removed.</p>
<p><b>Examples:</b></p>
<ul>
<li><code>Integer i = new Integer(1);</code> &rarr; <code>Integer i = Integer.valueOf(1);</code></li>
<li><code>int i = Integer.valueOf(1);</code> &rarr; <code>int i = 1;</code></li>
</ul>
<!-- tooltip end -->
<p>
Use the <b>Only report truly superfluously boxed expressions</b> option to report only truly superfluous boxing,
where a boxed value is immediately unboxed either implicitly or explicitly.
In this case, the entire boxing-unboxing step can be removed. The inspection doesn't report simple explicit boxing.
<p>This inspection only reports if the language level of the project or module is 5 or higher.</p>
</body>
</html>