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

23 lines
707 B
HTML

<html>
<body>
Reports annotations used on record components that have no effect.
<p>This can happen in two cases:</p>
<ul>
<li>The reported annotation has the METHOD target, but the corresponding accessor is explicitly defined.</li>
<li>The reported annotation has the PARAMETER target, but the canonical constructor is explicitly defined.</li>
</ul>
<p>Example:</p>
<pre><code>
@Target(ElementType.METHOD)
@interface A { }
// The annotation will not appear in bytecode at all,
// as it should be propagated to the accessor but accessor is explicitly defined
record R(@A int x) {
public int x() { return x; }
}
</code></pre>
<!-- tooltip end -->
<p><small>New in 2021.1</small></p>
</body>
</html>